Live data from Hacker News

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

twitter.com

631–640 of 817 posts

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

#631
post #480

Earlier quoted context omitted.

I've read that a handful of times (whenever trying to figure out where to put some new random thing), and still have never come to a clear conclusion. Even better, because there are so many similar places, you might choose completely different ones depending on the day of the week and your current mood. Too much choice for things like this is harmful IMO. Deep down I truly couldn't care less where the files end up, a…

It’s not just you: Every distro is its own special snowflake and patches the programs they distribute to store files in a different place. The “standard” doesn’t tell you what directory structure to use inside /etc to group related config files. The “standard” doesn’t tell you where an HTTP server should serve its files. Everyone just does their own thing which makes upstream docs incorrect and useless for newcomers.

> The “standard” doesn’t tell you what directory structure to use inside /etc to group related config files. The “standard” doesn’t tell you where an HTTP server should serve its files. Everyone just does their own thing which makes upstream docs incorrect and useless for newcomers.

The FHS, does actually answer both of of those questions. Files inside /etc/ should be grouped in subdirectories[0] andd the HTTP server should serve user-specified website files from /srv[1] and normal distro-provided files (such as the apache test page) from /var[2].

[0]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s07.htm...

[1]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s17.htm...

[2]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05.html#p...

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

#632

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…

Spaces are a pain in the ass when you're using CLI so I'd rather enforce a no space policy

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

#633

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…

Seems like MS had the same idea according to an answer in the link: > Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to force programmers to deal with spaces in filenames.

Except for programs that were too old / obscure to fix I guess. I think at least the Symbian Development Kit was such that builds would fail with strange errors unless you installed it in any other path than the default immediate subdirectory of C:\, let alone under "Program Files".

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

#634
post #411

I have an overly-aggressive function in my .bashrc to rename all files in the current directory: # Rename all files in a directory rn() { rename "s/ /-/g" * rename "s/_/-/g" * rename "s/–/-/g" * rename "s/://g" * rename "s/\(//g" * rename "s/\)//g" * rename "s/\[//g" * rename "s/\]//g" * rename 's/"//g' * rename "s/'//g" * rename "s/,//g" * rename "y/A-Z/a-z/" * rename "s/---/--/g" * rename "s/-‎--/--/g" * } I use th…

I wonder if rename has an -e flag like sed. It might be worth baking this into one monolithic regex if you call this often

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

#635
post #190
post #173

Earlier quoted context omitted.

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

> I wonder how hard it would be to rearrange the folder structure in linux

Restructuring the directories is the easy part. You just delete the old tree and make a new one. You can also mount procfs and sysfs wherever you want.

The hard part is modifying existing software to work with the new tree. So many programs assume you have a "standard" file system tree. So many programs assume procfs is mounted at /proc. So many programs have hardcoded paths. Shared library locationd can become part of the binaries when they're compiled. It's insane and you'd essentially be creating a new Linux distribution.

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

#636

Define " space ". Is the Hangul filler we talked about yesterday a spacing character? Is the zero-width non-breaking space a spacing character? What about the typographic spacing characters? You should better be very afraid of using spaces in filenames. You should do everything you can to support them but you have to know you'll invariably encounter countless cases where you'll have this or that tool that won't work…

> FWIW, and it should be food for thought, every single Git repository in the world contains a pre-commit hook sample (disabled by default but it's there) that enforces that every committed file in the repo is named using a subset of ASCII characters. I use Git for documents too, not only code. Why shouldn't I use my native language?

non-ascii characters cause annoying hard to fix problems. If you're willing to deal with that - kudos. Personally I don't find it worthwhile

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

#637
post #86

Earlier quoted context omitted.

The shell ought to be able to help with that. There's no need to remember if it's --conf or --config if you can press --conf . One of the things I like about Fish is that by default it can tab-complete program options and also shows a one-line description of what each of them does. (It grabs that info from the man page).

I just tried fish. xinput --set-[TAB] and nothing. Apparently it doesn't understand the standard long-option format that is supported by xinput and documented in the man page. You have to know to omit the dashes and then it'll complete. And it's downhill from there. Yeah I used to have all kinds of simple as well as supposedly sophisticated completion setups with zsh years ago but I've given up on it since then. It's…

I run fish. I was able to get long-option completion for gcc, polybar, firefox, man, emacs, xrandr, and fish itself. The only command I was not able to get long-option completion for was xinput. You just picked a bad program to try.

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

#638

Earlier quoted context omitted.

How was this possible? None of the mainstream operating systems allow this.

via GUI in OS X.

Ah so that’s not really putting a slash in the name on disk - finder is just displaying the colon that way - it substitutes with a colon for historical reasons that have to do with pre OSX MacOS (but you can see if you create a file from a program or the command line with a colon in it, it will display as a slash in finder). It shouldn’t cause any problems on its own on the system - but the colon is troublesome if you have to interact with DOS/Windows lineage machines.

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

#639

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…

See the recent article about unicode invisible glyphs in JavaScript or bash.

Naming freedom needs a stdlib module

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

#640
post #632

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…

Spaces are a pain in the ass when you're using CLI so I'd rather enforce a no space policy

Most shells will behave just fine if you put a quote (single or double) before anything that has a space.

A small extra step but something you get used to if you spend a lot of time in the cli.

Post reply on HN