Are spaces in filenames a problem?

April 12, 2019 at 11:31:41
Specs: several
Should I bother to remove or replace spaces in filenames
with some other character? I'm pretty sure I have always
done so when putting a file on the Internet. But is it worth
doing it with files just for my own use?

(I'd post this in "general operating systems" if there were
such a category.)

-- Jeff, in Minneapolis


See More: Are spaces in filenames a problem?

Report •

#1
April 12, 2019 at 12:18:39
It used to be the case that spaces should be avoided within filenames as they could cause issues with older software but these days such software is (hopefully) in the past so issues should not occur. Some of my older acquaintances say better to be safe than sorry but I've yet to encounter any problems with using spaces.

"I've always been mad, I know I've been mad, like the most of us..." Pink Floyd


Report •

#2
April 12, 2019 at 23:14:45
Depends on the OS. Windows programs generally don't have an issue with it. Linux programs tend to.

How To Ask Questions The Smart Way


Report •

#3
April 13, 2019 at 05:32:46
So, for your own use in Windows there is no point or advantage in removing spaces.

Always pop back and let us know the outcome - thanks


Report •

Related Solutions

#4
April 13, 2019 at 06:26:38
If Linux programs "tend to" have a problem with spaces, that
may be enough for me to more aggressively avoid using spaces
than I have in recent years. I sometimes use an Ubuntu disk to
look in folders or alter files that Win 10 won't let me fool with.

-- Jeff, in Minneapolis


Report •

#5
April 15, 2019 at 02:56:52
Spaces are really only a problem (more an inconvenience) when using command line tools. Personally I avoid them as I use the command line quite a lot, and it's hardly difficult to use an underscore rather than a space.

Filenames with spaces are likely to cause annoyance in Linux either at the command line or in scripts and configuration files.


Report •

#6
June 18, 2019 at 07:30:07
On Windows, spaces can also cause problems in URL usage, as they must be parsed because URL's still don't allow spaces. So, if an URL includes file names ... you see where it is going.

As a general rule: avoid them where possible.

Just see what Microsoft does: they support spaces since decades, but if you look at Windows files, most have no spaces ... That's cause they understand the problem, and at the same time allow end-users to use spaces.

Linux and Unix: they support spaces, but it's a pain to use them, and the OS files hardly never use them. In fact, if you only use console and command line, it take a long time before you see a file with a space. And then, you can't even use it (not in the normal way). PITA, that is what they are.

message edited by Looge


Report •

#7
June 18, 2019 at 09:19:33
Looge: Just see what Microsoft does
"Documents and Settings", "Program Files", more recently "Program Files (x86)"

Look, Windows is under a different set of constraints concerning file names than basically anything else. Until semi-recently, Windows had to keep to the old 8.3 filename standard used in the DOS days, and ain't no one encouraging that. Windows allows and uses, and initially encouraged spaces because it's not centered around the command line. Linux / UNIX does, and so you have extra difficulty when you encounter a file name that incorporates the token separator.

How To Ask Questions The Smart Way


Report •

#8
June 18, 2019 at 13:38:34
I just recently tried to read a file that my friend put on a flash drive,
but couldn't. Windows wasn't able to see it. The name of the folder
it was in had a centered dot at the end. Rather than attempting to
change the name of the folder myself, I took the flash drive back to
my friend to change it. On his Apple computer the dot appeared as
a space at the end of the folder name. Deleting that character
made the file readable in Windows.

-- Jeff, in Minneapolis


Report •

#9
June 19, 2019 at 21:08:47
I do sometimes use spaces but I find that just using Capitol Letters to designate the beginning of a new 'word' within the name works to make it readable. Example:
JustUsingCapitolsMakesItReadable
and is easier to type than an underscore and uses less characters so also avoiding long file name issues when using nested folders at the same time.

You have to be a little bit crazy to keep you from going insane.


Report •

#10
June 21, 2019 at 00:32:51
These are directories, I said "files" :)

Run this & report your output:
dir "C:\windows\* *.dll" /S

message edited by Looge


Report •

#11
June 21, 2019 at 00:34:58
That's a character issue, nothing to do with white space support. Windows supports white spaces at the end of the file, before the extension. So whatever was the issue, it was a character set issue.

message edited by Looge


Report •

Ask Question