Live data from Hacker News

I'm “still afraid to use spaces in file names” years old

twitter.com

181–190 of 817 posts

Re: I'm “still afraid to use spaces in file names” years old

#181
post #138

Still way too many libraries and programs can't handle spaces in filenames. And shells and other programs still have problems with perfectly legal characters in filenames too, like '!' or ':'.

Was recently encoding my Stargate: SG-1 DVDs to move them to plex. I was encoding it on a system other than what was serving it, so I had to copy it. It's surprisingly difficult to "scp" a file with a colon in it directly. I also love when you're using bash and you have a file with ! in the name, and you accidentally fail to correctly backslash it, you not only get "bash: !rest_of_filename: event not found", but it a…

That sounds like... Puzzle time! I had to cheat, sort of, by looking at the man page:

> Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing ':' as host specifiers.

So `scp foo:bar user@host:~` fails because it tries to find the host foo. But `scp ./foo:bar user@host:~` works just fine. I feel kind of stupid for not guessing as much.

Re: I'm “still afraid to use spaces in file names” years old

#182

Earlier quoted context omitted.

The root cause is that argv isn't a first-class citizen like on linux, but an abstraction. The kernel only cares about a single string argument. If you use main instead of WinMain, the CRT will transform the single string into an argv for you. Oh and cmd.exe uses a different escaping scheme than the CRT.

Microsoft is in full control of the Windows kernel, so they can make it care about whatever they want to, and one would think better argument passing would be a nice quality of life improvement. Less nonsense for developers to deal with, and less weird bugs on the platform.

Sure, but MS values backwards compatibility a lot.

They aren't going to break existing API or bloat the kernel with a bunch of functions that do the same thing.

Re: I'm “still afraid to use spaces in file names” years old

#183
post #168

Earlier quoted context omitted.

There is no guarantee that the short name has that. In fact on a lot of German Windows installations it was PROGRA~2.

Well, on my disk PROGRA~1 is "Program Files" and PROGRA~2 is "Program Files (x86)", so still works :)

That order is not guaranteed consistent across installations, however.

Re: I'm “still afraid to use spaces in file names” years old

#184
I had half a feeling that the warning against using spaces in names pre-dates computing, but after a little research into library call numbers and archive accession numbers, which turn out to have both historically included spaces, I have found no evidence to support this feeling.

Re: I'm “still afraid to use spaces in file names” years old

#185
post #162

I work on a complex desktop application, and it's been astounding the number of bugs that have appeared over the years triggered by spaces and other unusual characters in file names. If you do anything with subprocesses or path processing, it's absurdly easy to hit in a thousand different ways, over and over again. Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space an…

> Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space and/or special characters in it. A former co-worker changed his name in our auth system to include an apostrophe, so that whenever we handled names wrong he'd find it.

I set my nickname to U+FFFD at one point in one work system, resulting in a variety of bug reports and concerned emails. I think I dropped it since it was generating false reports from people who didn't check what character the page contained before reporting it.

Re: I'm “still afraid to use spaces in file names” years old

#187

I am also that age, and kebab-case is the best case for filenames. 2021-01-01-some-important-document.pdf gives me the warm fuzzies. On the off chance that some more differentiation is needed, throw in an underscore and a whole new world opens up

> 2021-01-01 Yes on the date format. Saves you so much time.

Agreed on dates ordering problem but 20210101 is so much easier to type.

Re: I'm “still afraid to use spaces in file names” years old

#188
post #89

Earlier quoted context omitted.

Cue nmcli (CLI for Gnome's NetworkManager) which uses UUIDs for everything and (at least a while ago) did not accept partial-but-unique UUIDs. Basically goes "nmcli connection up 5095665a-d82c-4ae6-8964-283623387941".

By this point, I'm pretty sure there are people at gnome who compete to see who will make the stupidest suggestion that gets put in production.

It's a Gnomespiracy to determine whether worse is actually better.

Re: I'm “still afraid to use spaces in file names” years old

#189
I'm not young, but I've been using Macintosh computers regularly since 1990, and even back then file names could be up to 31 characters long, and could include any character except colon.¹ So I'm pretty comfortable using spaces, and sometimes even non-ASCII characters, in file names.

Also back then Mac file names typically did not include an extension, because the file's type was stored as part of the metadata in its resource fork. I remember one time a friend of mine was visiting and was playing around with a paint program on my Mac. Being used to DOS, when she went to save her file, she typed a very short name, and then asked me what the proper file extension should be. I smirked and said, "That's not how you name files on a Mac. THIS is how you name files on a Mac." And then I named her file "Ailsa's Cool Picture". Her mind was blown. :-)

¹This is because the colon was the path separator. But since the classic Mac OS had no command line interface, the typical user would never type or even see a file path written out.

Re: I'm “still afraid to use spaces in file names” years old

#190
post #173

Earlier quoted context omitted.

They used to. The folder was called `Documents and Settings` until Win7.

"Documents and Settings" still exists on Windows 10, as a soft link to "Users".

You know, this makes me wonder.. tangentially speaking- I wonder how hard it would be to rearrange the folder structure in linux so that I have something like this:

/Users/{root, user0, user1, ... }...

/System/{Logs, Apps/{opt, container, ...}, Temp, Conf ...}...

/Devices/{Mount, sda, sdb, null ...}...

/Boot/...

Post reply on HN