LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Problems with Fat long file names in Bash (https://www.linuxquestions.org/questions/slackware-14/problems-with-fat-long-file-names-in-bash-329717/)

brett90 06-02-2005 05:49 PM

Problems with Fat long file names in Bash
 
Hi people
Im having some problems with the way the shell is dealing with directories containing spaces in there names stored on my windows drives. For example when im logged in as a normal user the directory: network tunez appears as network\ tunez/ and other strange combinations. However if im logged in as root, the directory names appear as they should but do not allow me to change to them?.
This is causing me alot of bother with mplayer for example where it cannot locate mp3's using playlists, even with a playlist that rythumbox & other xwindows players have no problem using and locating the files from.

do i need to add anything to /etc/fstab to resolve this?

Thanks in advance
Brett

gbonvehi 06-02-2005 05:51 PM

They will appear in that "cryptic" way because a space is represented with "\ " combination on console, it's normal. The last / indicates it's a directory.
I don't know how it appears with root, give some examples so we can spot the problem.

killerbob 06-02-2005 06:03 PM

The backslash indicates that it's a broken character. It's used extensively in scripting languages, including just about every programming language in use today.

What it means is that a specified macro character is following the break, and that the two characters should be treated as one with a special meaning. "\ " is a space. There's dozens that I know of, and probably a few I don't know, but the most common are "\n" for new line feed, "\r" for carriage return, "\b" for break, "\\" for a backslash, and so forth. You can also break any punctuation that's being used to indicate the start of your string. So a string variable 'I\'m really going crazy, here!' will be read as I'm really going crazy, here!.

In BASH (and other shells), a space means you're separating arguments. If you type ls network tunez, you'll get two messages. One will say that it couldn't find the directory "network". The other will say that it couldn't find the directory "tunez". You *need* to break the space so that it's treated as a space and not a separator. The only other way to get it working is to type ls "network tunez".

Incidentally, that's not a problem that's unique to Linux. You don't see it in Windows because you're using the GUI. You may have noticed that any GUI file browsers in Linux also don't show you the broken space. The command line in Windows, however, will require quotation marks. (in Windows, you can't use the backslash as a break character, because it's used as a directory separator. You can also see it when you use the CLI shell on Mac OS/X.

brett90 06-03-2005 04:23 AM

Thanks for the reply.... im still however having problems with mplayer addressing files stored in these directories.. despite copy & pasting this path into a playlist file

gbonvehi 06-03-2005 11:59 AM

Can you give us some more information?
What are you copying into MPlayer (the exact string) and where?
Also which is the name of the directory, and, can you access it outside mplayer?

killerbob 06-03-2005 12:15 PM

He did say that other players work, so I would assume that he can access it outside of mplayer.

Knowing exactly what string he's putting into mplayer could be important. If he isn't breaking the space, for example. I believe the directory's name is "network tunez" as his original post said. If not, it's probably close enough.

I don't know mplayer specifically, but I am kind of wondering what version of the software he's using. I was under the impression, after seeing the website (http://www.mplayerhq.hu/homepage/index.html), that mplayer development has been put on hold until the EU's copyright laws are reexamined. I could be wrong, however. I usually stick to xine for movies, and JuK for MP3/OGG. FWIW, JuK has no problem at all with spaces in file names, but it does require that the space be broken. ("\ ")


All times are GMT -5. The time now is 06:58 PM.