You are not logged in.

#1 2007-12-14 14:24:49

orv
Member
Registered: 2007-12-13
Posts: 11

Can't open a file with spaces on the filename.

Lets say I have a file:

/home/orv/Open - Me - Please.txt

When I double click to open that file with any program, the result is something like this:

"Unable to find /home/orv/Open%20-%20Me%20-%20Please.txt"

I'm not sure what to call that process of converting the file name so I've been unable to google it up to find a fix or a way to change the behavior of the file manager.

I've checked the settings in Nautilus and nothings there. Any clues? Thank you!

Last edited by orv (2007-12-14 23:11:59)

Offline

#2 2007-12-14 23:33:04

Warren Watts
Member
Registered: 2007-09-09
Posts: 22

Re: Can't open a file with spaces on the filename.

I don't know about file manager behavior, but from the command line you can use quotes:

mv "/home/orv/Open - Me - Please.txt" /home/orv/Open_Me_Please.txt

-or-

nano "/home/orv/Open - Me - Please.txt"

Last edited by Warren Watts (2007-12-14 23:34:39)


Dual Boot: Arch Linux/Wolvix Cub - 700 MHz AMD Duron - 256MB RAM - 10GB Hard Drive - 8MB AGP
             Ubuntu 7.04 - 450MHz Pentium III - 384MB RAM - 10GB Partition - 32MB AGP

Offline

#3 2007-12-14 23:53:42

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Can't open a file with spaces on the filename.

or you can escape spaces with backslashes; so your command would look something like this:

mv /home/orv/Open\ -\ Me\ -\ Please.txt" /home/orv/Open_Me_Please.txt

EDIT: oh wait, I thought you meant from command line...  I don't know what the problems is with your setup, filenames with spaces work fine for me with gui apps like thunar etc.

Last edited by fwojciec (2007-12-14 23:55:17)

Offline

#4 2007-12-18 02:33:56

orv
Member
Registered: 2007-12-13
Posts: 11

Re: Can't open a file with spaces on the filename.

I have no problem with the commandline. It's only an issue in GUI, particularly in my gnome setup using nautilus as the file-manager. I couldnt figure it out so i'm gonna reinstall everything from scratch and see what happens. Thanks for your suggestions though! smile

Offline

#5 2007-12-18 04:25:10

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Can't open a file with spaces on the filename.

orv wrote:

I have no problem with the commandline. It's only an issue in GUI, particularly in my gnome setup using nautilus as the file-manager. I couldnt figure it out so i'm gonna reinstall everything from scratch and see what happens. Thanks for your suggestions though! smile

Don't! It'll change nothing...
Tell us exactly what you want to do and we'll help you out.


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#6 2007-12-18 10:39:02

Mantaar
Member
Registered: 2007-12-17
Posts: 70

Re: Can't open a file with spaces on the filename.

Wiping everything won't usually help because the per-user config is stored in dotfiles in your $HOME-directory. You could try moving ~/.config and ~/.gnome* to some different folder(names) and see if it helps (do that befor logging in! Best is to log out of Gnome altogether, switch to a VT and do it from there. Then log in again).

Alternatively, you could try the gconf editor - it's been a while since I last used Gnome, but maybe it contains some options - browse around and see if you can find something odd.

Last edited by Mantaar (2007-12-18 10:40:27)


Guy #1: I'd totally hit that.
Guy #2: Dude, I'd hit that so hard whoever could pull me out would become the King of England.
--College Walk, Columbia University (Overheard in NY)

Offline

#7 2007-12-18 20:22:25

orv
Member
Registered: 2007-12-13
Posts: 11

Re: Can't open a file with spaces on the filename.

I tried removing everything in my home directory to erase all settings, still the same problem.
I tried using a different file manager and still the same problem.

Here's another example of my problem and its quirks:
Lets say I have a file called:

/home/orv/I am a Movie.avi

In nautilus or thunar, double-clicking that file so I can play it with Mplayer will give an error:

Failed to open file:///home/orv/I%20am%20a%20Movie.avi

However, when I drag and drop using the file manager into Mplayer, it works.

So my problem is this automatic conversion of whitespaces into the %20 which I don't know how to turn off.

Offline

#8 2007-12-18 21:47:56

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Can't open a file with spaces on the filename.

That's a random guess, and maybe my thinking is going in a completely wrong direction here, but couldn't this be something that's affected by locale settings?  Try changing to a different locale in rc.conf and locale.gen - maybe it'll help...

Offline

#9 2007-12-20 17:57:23

fabioaquotte
Member
From: Brazil
Registered: 2007-03-13
Posts: 3
Website

Re: Can't open a file with spaces on the filename.

First edit (as root) this file:

/usr/share/applications/mplayer.desktop

and change the line that reads:

Exec=gmplayer %U

to:

Exec=gmplayer %F

Then run (also as root):

update-desktop-database

The '%U' tells nautilus to pass the file name to mplayer as a URL (file:///home/orv/I%20am%20a%20Movie.avi) which mplayer doesn't understand. Changing it to '%F' tells nautilus to pass it as a regular file name (/home/orv/I am a Movie.avi) and fixes the problem.

Offline

#10 2008-09-10 12:13:33

afonic
Member
Registered: 2007-06-21
Posts: 53

Re: Can't open a file with spaces on the filename.

Thanks, that solved my problem. big_smile


Your source for video guides!
My Linux reviews.
Currently using: Intel Core 2 Quad Q9300 @ 3.5GHz, 2GB RAM, Asus P5E, nVidia Geforce 8800GTS, Arch Linux

Offline

Board footer

Powered by FluxBB