May 25, 2008

PCMan File Manager: 7z and rar archives

By default, pcmanfm will not extract/create 7zip and Rar archives. Extracting rar archives is already implemented but not enabled by default while the ability to extract 7z archives is not implemented at all. To enable the extraction of rar and 7zip archives and the creation of 7zip archives open src/ptk/ptk-file-archiver.c:


Uncomment:


{
"application/x-rar",
NULL,
"unrar -o- e",
".rar", TRUE
}

And add this below:


{
"application/x-7z-compressed",
"7zr a -bd -y",
"7zr x -bd -y",
".7z", TRUE
}

Next, insert a comma, after the end bracket of the rar section.
The archive handlers section should endup looking like this:

const ArchiveHandler handlers[]=
{
{
"application/x-bzip-compressed-tar",
"tar --bzip2 -cvf",
"tar --bzip2 -xvf",
".tar.bz2", TRUE
},
{
"application/x-compressed-tar",
"tar -czvf",
"tar -xzvf",
".tar.gz", TRUE
},
{
"application/zip",
"zip -r",
"unzip",
".zip", TRUE
},
{
"application/x-tar",
"tar -cvf",
"tar -xvf",
".tar", TRUE
},
{
"application/x-rar",
NULL,
"unrar -o- e",
".rar", TRUE
},
{
"application/x-7z-compressed",
"7zr a -bd -y",
"7zr x -bd -y",
".7z", TRUE
}
};
C0mpile with a standard ./configure; make; make install or ./configure; make; checkinstall.

12 comments:

Josh Stroud said...

What the hell is with your sick fascination with linux?

Steven said...

It's not a sick fascination; it's a healthy interest. Linux, in my opinion, is a much better operating system than both windows and MacOS.

Robert Mushkatblat said...

My name is Robert Mushkatblat.
I just wanted to say that I think your blog is wonderful. I stumbled on in while I was web-browsing maybe a week ago, and it's one of the few really hard-core technical Linux blogs I've been able to find. Being a devout RedHat man, I find a blog like yours catering to specific interests to be refreshing. Don't listen to Josh Stroud: linux is awesome.

Steven said...

Robert: Thanks.

Robert said...

Please ignore the above comment by... well, me.
I suspect that JOSH STROUD decided to troll my name and post it for his amusement; he has done similar things in the past.

Thanks, Robert.

Fyn said...

This has been a very handy find for me. I've been using this pcmanfm mod since well before Christmas\and like the convenience of it a lot.

I don't know of any other website that has this info. Not even the pcmanfm homepage. So thank you

ElReyZope said...

I think so... and in spanish too... Linux es
increible.

new2linx said...

i ahve a quesiton. i did all your steps above but after I open pcmanfm and run it, i right click on a rar set file and there is no option to extract it. is there something else I am suppose to do? also, i had a weird problem, i use ubuntu but I have only 256 of ram so I am using LXDE as my desktop manager and trying pcmanfm as my file manager. i tried to uninstall pcmanfm using aptitude but aptitude wanted to remove LXDE and all of it, so I had to leave pcmanfm from aptitude ubuntu package and then overwrite the executable in /usr/bin/. hopefully everything is fine that I did but I didn't know how to remove pcmanfm using aptitude but keep lxde and lxde-core and whatnot. any help would be appreciated.

Steven said...

Using 'checkinstall' instead of 'make install' will solve your dependency problem with LXDE and will install the whole application properly. Just compile the application normally but run 'sudo checkinstall' instead of 'sudo make install'.

Alan said...

I have a question, how do I remove pcmanfm completely and return to nautilus, on Ubuntu 9.10 (karmic) Gnome 2.28.1 Keep up the good work.
Alan.

Steven said...

@Alan: If you installed it with 'sudo checkinstall', uninstall it with the package manager (sudo apt-get purge pcmanfm)
If you installed it with 'sudo make install', go into the source directory and run 'sudo make uninstall'.
If you removed nautilus, run 'sudo apt-get install nautilus'

Alan said...

Excellent, thank you. I hadn't removed Nautilus so no problem. I don't know why but I wasn't very impressed with PCmanfm. I had trouble making it perform the correct actions when I clicked on different file types, it always wanted to do the same thing and I couldn't seem to configure it. Thanks again for your fast accurate help.

Post a Comment