Live data from Hacker News

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

twitter.com

171–180 of 817 posts

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

#171
post #126

Earlier quoted context omitted.

I see that there are lots of comments about problems of TAB-completions with filenames with spaces in this comment section and I am frankly puzzled: both Bash and cmd.exe actually TAB-complete those perfectly fine, inserting quoting where it's needed.

And where it isn't needed. If you have a path that contains a variable and a space, bash will happily escape the $, making the path invalid. See the following: $ cd $HOME $ mkdir my\ dir $ ls my[tab] $ cd / $ ls $HOME/my[tab] ls: cannot access '$HOME/my dir/': No such file or directory That error is because when you press [tab], bash changed the path to \$HOME/my\ dir/ but that isn't obvious from the output and I cou…

Depends on the Bash version, I guess? Mine is 4.4.20(1) and when I do "cd $HOME/my[TAB]", it replaces the input line with "cd /home/joker/my\ dir/", and pressing [ENTER] changes the directory to '/home/joker/my dir', as can be seen from the prompt.

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

#173

Earlier quoted context omitted.

I wish they did "User Files" instead of "Users" too, because so much software breaks on the home area having a space in it. Not least, it makes writing scripts for various shells and getting the quoting rules right an absolute pain as well...

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".

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

#174

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

In my work, today's date would be 21K11, to save space over the longer date.

How do you distinguish 21K111 and 21K111?

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

#175
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.

Oh, I like this!

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

#176
There was some prior discussion about a generational shift here at https://news.ycombinator.com/item?id=28615884 -- there's an idea that people no longer need to know what files or folders are in order to get things done day-to-day with software ( https://www.theverge.com/22684730/students-file-folder-direc... ).

I'm wondering when the first generation of college students will start who have never used a physical keyboard to input text.

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

#178
Coming from web-heavy and perl5 backgrounds, it's insane to me that people don't treat filenames and arguments and environment variables as tainted user input, and just blindly trust properties about them like "does not contain whitespace or control characters".

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

#179
post #109

I had a guy in my team use forward slashes in filenames. Terrible idea, caused all sorts of weird issues.

Did you mean backslashes? I don't know if any filesystem/OS supports forward slashes in filenames

OS X does in the GUI; they're isomorphic to ‘:’ at the UNIX level. (The Mac used ‘:’ as the directory separator.)

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

#180
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…

It's almost like in-band signaling isn't a good idea or something.
Post reply on HN