Page 1 of 1

PCman can't open files with spaces in the name

Posted: Thu Dec 27, 2012 9:49 pm
by TheBigH
If my file is called /path/to/directory/Herp Derp.txt

then PCman will refuse to open it, saying
"Failed to open child process /path/to/directory/Herp (No such file or directory)"

My guess is that it's trying to open something called Herp, with Derp.txt as a command line argument.

How do I fix this problem?

Re: PCman can't open files with spaces in the name

Posted: Thu Dec 27, 2012 9:57 pm
by cwsnyder
You might try renaming the file without the space in the name by right-clicking on the name and selecting Rename from the context menu in PCManfm.

If that doesn't work, you can do it from the terminal by using cd to move to the folder containing the file and then using the command mv "Herp Derp.txt" Herp_Derp.txt to rename the file.

Re: PCman can't open files with spaces in the name

Posted: Thu Dec 27, 2012 10:08 pm
by TheBigH
That's not really an option. I have too many files to rename them all, it'd take me forever. Besides, why should I have to? Why can't PCman do what it's meant to do?

Re: PCman can't open files with spaces in the name

Posted: Thu Dec 27, 2012 11:01 pm
by abnvolk
You must use the escape character before the space. For example pcmanfm My\ Folder to open "My Folder". Alternatively type pcmanfm "My Folder".

Re: PCman can't open files with spaces in the name

Posted: Fri Dec 28, 2012 8:26 am
by cwsnyder
TheBigH wrote:That's not really an option. I have too many files to rename them all, it'd take me forever. Besides, why should I have to? Why can't PCman do what it's meant to do?
It is doing exactly what it is designed to do. Linux file name conventions don't pay any attention to extensions and can be any length. Linux applications pay attention to the content of a file. A space is used by Linux to delineate a break between file names unless it is either escaped by a \ or entered as a %20. You can also use PCManfm to move the files, however they are named, by drag & drop. The only thing you can't do is to simply double-click on a file to open it if you use a space in the name.

The fault is not in PCManfm, it is in your use of PCManfm.

Re: PCman can't open files with spaces in the name

Posted: Fri Dec 28, 2012 5:40 pm
by TheBigH
That seems like more of a misfeature actually. There's plenty of reasons why you might end up with lots of files with spaces in their names, so it's unhelpful to say "Just don't have spaces in file names, the computer's right and you're wrong, so nergh". In my case it's because I've saved a list of mobile phone contacts from a friend's phone that was dying, and they've come out as over 200 individual files with names like "John Smith.txt" or "Jane Doe Home.txt".

It seems to me that an intelligent file manager should be able to interpret a group of space-separated things as a single file name if it can't successfully interpret them as a single word command followed by command line arguments.

If PCmanfm won't do what I want I may need to remove it and install one that has this simple, sensible ability. Are there any good ones that can do it?

Re: PCman can't open files with spaces in the name

Posted: Fri Dec 28, 2012 7:00 pm
by altair4
Just so I understand the nature of the problem, you are double clicking a file with a space in it's name and you are getting that error?

Not sure why but I have PCManFM installed on my Xubuntu 12.04 box and it doesn't exhibit that behavior. I just installed it in a Mint14 Cinnamon VBox guest and it doesn't do it there either.

And in both cases I made it harder since the path was /home/altair/Test Folder/test file.txt

Maybe it's not PCManFM that is the culprit - could it be your default text editor?

Re: PCman can't open files with spaces in the name

Posted: Sat Dec 29, 2012 3:07 am
by TheBigH
altair4 wrote:Just so I understand the nature of the problem, you are double clicking a file with a space in it's name and you are getting that error?
Yes, that's right.
Maybe it's not PCManFM that is the culprit - could it be your default text editor?
I just tested that idea now, and it's definitely the file manager because it chokes on directory names with spaces as well.

Re: PCman can't open files with spaces in the name

Posted: Sat Dec 29, 2012 1:48 pm
by cwsnyder
It could also be the version of PCmanFM which you have vs. the one in Ubuntu. Just for giggles, I tried in Thunar 1.2.3 (Debian Wheezy Xfce) with a file with multiple spaces in the name, and it opened mousepad with no problems.