PCman can't open files with spaces in the name

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

PCman can't open files with spaces in the name

Postby TheBigH on Thu Dec 27, 2012 9:49 pm

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?
TheBigH
Level 1
Level 1
 
Posts: 15
Joined: Sat Jun 09, 2012 5:24 am

Linux Mint is funded by ads and donations.
 

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

Postby cwsnyder on Thu Dec 27, 2012 9:57 pm

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.
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

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

Postby TheBigH on Thu Dec 27, 2012 10:08 pm

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?
TheBigH
Level 1
Level 1
 
Posts: 15
Joined: Sat Jun 09, 2012 5:24 am

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

Postby abnvolk on Thu Dec 27, 2012 11:01 pm

You must use the escape character before the space. For example pcmanfm My\ Folder to open "My Folder". Alternatively type pcmanfm "My Folder".
abnvolk
Level 4
Level 4
 
Posts: 495
Joined: Thu May 10, 2012 11:05 am

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

Postby cwsnyder on Fri Dec 28, 2012 8:26 am

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.
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

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

Postby TheBigH on Fri Dec 28, 2012 5:40 pm

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?
TheBigH
Level 1
Level 1
 
Posts: 15
Joined: Sat Jun 09, 2012 5:24 am

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

Postby altair4 on Fri Dec 28, 2012 7:00 pm

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?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5986
Joined: Tue Feb 03, 2009 10:27 am

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

Postby TheBigH on Sat Dec 29, 2012 3:07 am

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.
TheBigH
Level 1
Level 1
 
Posts: 15
Joined: Sat Jun 09, 2012 5:24 am

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

Postby cwsnyder on Sat Dec 29, 2012 1:48 pm

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.
LMDE Mate 64-bit, LM16 Mate 64-bit
Debian Xfce 64-bit, Xubuntu 13.10 64-bit, Xubuntu Trusty Tahr 64-bit, Antergos Xfce 64-bit, PCLinuxOS LXDE 64-bit
cwsnyder
Level 6
Level 6
 
Posts: 1039
Joined: Wed Oct 20, 2010 6:49 am
Location: Nappanee, IN, USA

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], nt005 and 31 guests