Spaces allowed in-between words in a file?

Hi,

My first post here so hello to all.

I tried Suse five or six years ago and ran into an issue that was not comfortable to work with so I went back to windows. The problem was open spaces between words was not permitted with my music files. I have transferred all of my CDs and LPs to MP3 and have a tremendous number of them and the Suse of five years ago required I convert a title like Foggy Mountain Special.mp3 into something resembling Foggy_Mountain_Special.mp3

I don’t care to convert literally a hundred thousand titles to fit the latter format. Does the current version of Suse allow the use of spaces between the words or is the ‘no open space’ convention still required?

Thanks for the interest,

Gary

You can have spaces but it is not recommended since when referencing them on the CL you need to put quotes around the paths. But you need to do that on the Windows command line also.

It does depend on what applications you use; I rarely find having spaces in a filename is a problem with individual files but having spaces in folder names can upset those programs, particularly longstanding Unix programs, which do not accept spaces anywhere in a fully expressed filename.

The problem I encounter more frequently is with things which were created on a non-Unicode system which are not always compatible with a Unicode based system.

Space has always been a legal character in pathnames on Unix/Linux, but their use makes life more hassle in the CLI. Some programs and shell scripts aren’t sufficiently robust to deal with them correctly.

john hudson wrote:
> It does depend on what applications you use; I rarely find having spaces
> in a filename is a problem with individual files but having spaces in
> folder names can upset those programs, particularly longstanding Unix
> programs, which do not accept spaces anywhere in a fully expressed
> filename.

That’s nonsense. Unix has always allowed spaces in names. DOS and
Windows didn’t. Many Unix and GNU/Linux filesystems also allow lots of
other strange characters such as backspace and newline. It used to be a
great sport creating such files and leaving them around for newbies to
try to clear up.

The usual problem on modern systems is lazy people who forget the need
for quotes, either on the command line or in scripts that may be part of
applications. All of these occurrences are bugs that need to be
squashed. Reports of specific problems rather than vague generalizations
are needed.

I am with djh-novell here. And for the practical way of live with spaces in filenames (and not in files as the OP originaly expressed it), I have lots of them. Using the GUI gives no problem at all. Using the CLI they are most often easily “typed” by using the file name expansion feature of the shell. Type the first few characters, hit the Esc key and see how you long file name including the spaces (escaped by a ) is completed (as far as it is unique).

And yes, programming scripts is not that easy as it looks. For a good script you should cater for white space in fields, else you have a bug again :frowning:

@megalomando, yes now are allowed spaces in filenames, I have all my mp3 names with spaces :slight_smile:

Thanks for the replies. I’ve been a musician for 50 years and the ability to play and work with music files as their names exist is mandatory if I am to consider switching platforms. I enjoyed experimenting with Suse from 5 years ago but having to rename all music file names as one word was much too impractical to do and when I would play them on my Cd player, I didn’t like the look of the underscores in-between words.

I’ll devote a drive to Suse and give it another go. I don’t recall if Suse can read/write NTFS formated drives but all mine are NTFS as several files I have are well over 4GB.

Thank you all for the information.

Not only spaces. This is a filename on my system:

henk@boven:~> l Français\,\ Español\,\ Ελληνικό\,\ Русский\,\ हिनदी\,\ اردو\,
-rw-r--r-- 1 henk wij 0 jan 13 19:33 Français, Español, Ελληνικό, Русский, हिनदी, اردو,
henk@boven:~>

And I creted the* l* statment by typing* l Fra* and then hittting the Esc key.

The only characters that can not be in a file name are the / (it serves as the separator in the path) and the NULL character. Also better do not start a file name with a hypen -.

When you are using a non-Linux filesystem, there may be other restrictions/problems because those file systems lack some of the features native Linux file systems have. And not all of this can be faked/converted by the Linux software that interfaces to them.

On Thu, 13 Jan 2011 10:05:48 +0000, Dave Howorth wrote:

> That’s nonsense. Unix has always allowed spaces in names. DOS and
> Windows didn’t.

Well, it’s not entirely nonsense. While the filesystem has always
supported spaces, not all programs deal with them gracefully (especially
scripts). Similarly, I can start a filename with “-” but then if I do
something like try to delete it, I have to jump through hoops because the
shell (since rm is builtin to most shells) tries to apply it as a command-
line switch.

And while FAT16 doesn’t support spaces, FAT32 does - so it’s not accurate
to say DOS and Windows don’t support spaces in filenames, because they
have since at least Win95 as I recall (with long filename support
enabled).

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 2011-01-13, Megalomando <Megalomando@no-mx.forums.opensuse.org> wrote:
> Thanks for the replies. I’ve been a musician for 50 years and the
> ability to play and work with music files as their names exist is
> mandatory if I am to consider switching platforms. I enjoyed
> experimenting with Suse from 5 years ago but having to rename all music
> file names as one word was much too impractical to do and when I would
> play them on my Cd player, I didn’t like the look of the underscores
> in-between words.

Don’t confuse the name of the file with the name inside the file.
The name displayed on your CD player shouldn’t be the filename, but the mp3
tag from inside the file.

I have all my mp3’s with underscores, but they all contain song/artists
names with spaces in them.

PS: renaming spaces to underscores is trivial, even for hundreds of
thousands of files. I wrote myself a little scipt that renames the files in
1 dir. I just use find to run that script on multiple dirs.


When in doubt, use brute force.
– Ken Thompson

I have huge amounts of audio data with spaces in their filenames and never had a problem with it.

I have never had a problem with it either

Yes it can. You can read from and write to NTFS formatted drives with most of modern linux distros including of course openSUSE.

Best regards,
Greg

Just to add to that AFAIK as long as ntfs-3g is installed on the distro you should be able to read and write to ntfs drives.

ntfs-3g is installed by default (if I remember correctly). Either way, working with NTFS is not an issue anymore.

It sure is:


andrew@linux-sqpk:~> rpm -q ntfs-3g
ntfs-3g-2010.3.6-1.12.x86_64

Jim Henderson wrote:
> On Thu, 13 Jan 2011 10:05:48 +0000, Dave Howorth wrote:
>
>> That’s nonsense. Unix has always allowed spaces in names. DOS and
>> Windows didn’t.
>
> Well, it’s not entirely nonsense. While the filesystem has always
> supported spaces, not all programs deal with them gracefully (especially
> scripts). Similarly, I can start a filename with “-” but then if I do
> something like try to delete it, I have to jump through hoops because the
> shell (since rm is builtin to most shells) tries to apply it as a command-
> line switch.

As I said, every script that doesn’t deal with them properly is buggy
(sloppy programmers, hence script kiddies).

And short of magic fairy dust, there’s no way to have a ‘-’ followed by
a letter mean two different things. So some syntactic noise is
inevitable. Speaking just for myself, I can count the number of times
I’ve wanted to start a filename with a ‘-’ over the last thirty years on
the fingers of one foot :slight_smile:

> And while FAT16 doesn’t support spaces, FAT32 does - so it’s not accurate
> to say DOS and Windows don’t support spaces in filenames, because they
> have since at least Win95 as I recall (with long filename support
> enabled).

I quite deliberately didn’t say “DOS and Windows don’t support spaces”,
I said “DOS and Windows didn’t” :stuck_out_tongue:

Cheers, Dave

On Fri, 14 Jan 2011 10:23:54 +0000, Dave Howorth wrote:

> Jim Henderson wrote:
>> On Thu, 13 Jan 2011 10:05:48 +0000, Dave Howorth wrote:
>>
>>> That’s nonsense. Unix has always allowed spaces in names. DOS and
>>> Windows didn’t.
>>
>> Well, it’s not entirely nonsense. While the filesystem has always
>> supported spaces, not all programs deal with them gracefully
>> (especially scripts). Similarly, I can start a filename with “-” but
>> then if I do something like try to delete it, I have to jump through
>> hoops because the shell (since rm is builtin to most shells) tries to
>> apply it as a command- line switch.
>
> As I said, every script that doesn’t deal with them properly is buggy
> (sloppy programmers, hence script kiddies).

Well, I don’t consider myself a script kiddie or a sloppy coder, but I
have noticed (at least in tcsh, which is my shell of choice) that
sometimes if I’m doing an operation on a directory of files, I
occasionally run into problems with files with spaces in the names.

Maybe I’m not as rigorous as I need to be, but if one is going to have
files with spaces in the names, one does have to be more careful in
coding than if filenames are not.

> And short of magic fairy dust, there’s no way to have a ‘-’ followed by
> a letter mean two different things. So some syntactic noise is
> inevitable. Speaking just for myself, I can count the number of times
> I’ve wanted to start a filename with a ‘-’ over the last thirty years on
> the fingers of one foot :slight_smile:

Well, yes, I know that there’s no way to tell the difference (unless the
program in question understands “–” to mean "no more parameters are
command-line options, which some programs do). I run into it when I
occasionally do a dumb thing when creating a file - I pass the wrong
thing to a program and the switch gets interpreted as a filename instead
of a switch.

It’s not a common thing I want to do either, for that very reason. I’ve
tried escaping it with \ and with single and double quotes - none of
those options work. I usually give up trying to do it from the command-
line and launch mc to deal with it.

>> And while FAT16 doesn’t support spaces, FAT32 does - so it’s not
>> accurate to say DOS and Windows don’t support spaces in filenames,
>> because they have since at least Win95 as I recall (with long filename
>> support enabled).
>
> I quite deliberately didn’t say “DOS and Windows don’t support spaces”,
> I said “DOS and Windows didn’t” :stuck_out_tongue:

OIC, yes, you did. But you have to admit, that either wording could be
construed as meaning “don’t”. :slight_smile: (And I speak as a pedant myself when
it comes to the English language <g>)

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C