Live data from Hacker News

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

twitter.com

471–480 of 817 posts

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

#471

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…

It doesn't even have to be complex, often basic automation tasks fail with spaces and special characters. Honestly, treating a file system like a natural language processor is a bad idea. Besides at this point with how digital we have all become who can't understand... thisismyconfig.txt vs this is my config.txt or this_is_my_config.txt ...i've forced myself to stop using spaces, character, and even cap. They are all…

> treating a file system like a natural language processor is a bad idea

could you please explain what you mean by that?

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

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

Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.

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

#473

Earlier quoted context omitted.

Are you trying to catch GP on differentiating hours, were it to be appended to his time format (1st @ 11 vs 11th @ 1am)? Notably he didn't promise any, but presumably one'd need a separator... Maybe, per his "K" usage of the month, one'd use the alphabet again. 11am would be "K" again... or lowercase just for giggles? I don't think it reads very well, but I also think one'd get used to it pretty quickly.

I was thinking January 11th vs November 1st. Maybe their "date" doesn't need/support day-of-month? Or they typod and I should just focus on my work.

I imagine January is A and November is K, so 21A11 vs. 21K1 (or maybe 21K01).

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

#475
post #468

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…

Or not, which when bugs crop up will teach the businessy types to stop putting spaces in their filenames.

The beatings will continue until morale improves?

Spaces are very useful for readability.

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

#476

Not afraid, but typing a dash in the terminal is easier and shorter than typing a reverse slash and a space. Spaces are kind of a pain in the ass in the terminal, tbh.

Quotes around the path is easier and avoids any issues - but tab completion and drag and drop files into terminal handles most cases for me.

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

#478
post #235

Earlier quoted context omitted.

work/client/project/2021-11-11-file.ext is great until you've got a '2021-11-11-project-status.txt' in a few directories and you need to find one quickly! I do a combination: clients/client/project/2021-11-11-client-project-update.txt

It sounds like what everyone in this thread needs is a database file system. This was always my favorite proposed feature of Windows Longhorn that never made the cut. Almost 2 decades later and Microsoft's latest OS still doesn't have this feature.

I wrote about what I perceived as deficiencies of hierarchical file systems, and proposed an alternative organization based on tags and hashes. It was discussed on Hacker News last week and many years ago.

https://www.nayuki.io/page/designing-better-file-organizatio... ; https://news.ycombinator.com/item?id=29141800

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

#480
post #320

Earlier quoted context omitted.

Behold! https://en.m.wikipedia.org/wiki/Filesystem_Hierarchy_Standar...

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.

Post reply on HN