Live data from Hacker News

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

twitter.com

601–610 of 817 posts

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

#601

Earlier quoted context omitted.

A related too for CI: change the system time to be a time zone that is during your work hours in a different day already than UTC. Really helped getting failures earlier than 4pm PST.

At my last job we had a wild time-zone bug that only happened with your system location set to Mumbai. I left mine set to that for the rest of my time there.

Related: here's a recent Firefox bug about a test that failed during the daylight saving time change:

https://bugzilla.mozilla.org/show_bug.cgi?id=1739847

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

#602
It's just such a pain in the butt to work with files with spaces. In a script it's fine b/c I just surround it in double quotes, but on the command line I hate having to escape the spaces.

This might already exist, but I wonder about a terminal that was really just a multi-line repl to a language. It would be preloaded with libraries that replicated all the features of the gnu core utils, but instead of calling grep like normal, you called a function like grep("args"). The advantage would be that you had access to a full blown programming language at all times. So when you needed to do something more complicated you would still have access to all the standard language features. And when you didn't need that, your canned core utils like functions would work

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

#604

I have an uneasy feeling whenever I see a path parameter declared as string. Path is not a string - it's a sequence of path components and should be treated as such by our APIs. A path should be parsed once - on user input - and then used in its "sequence form" throughout the software stack. And "path component" is not an arbitrary string either - e.g. appending a path component to the path should first require conve…

Strings following certain rules are entirely valid representations of paths, just like sequences of path components in the chosen language/framework are. Similarly, the sequences of bits that make up the sequences of your language/framework in memory are an entirely valid representation of said sequences of components.

Yes, paths have structure, but saying "a path is not a string" is equivalent of saying "C source code is not a string". Both are strings, and both are something else, represented by strings according to rules. Different internal representations have different advantages and disadvantages. I fully agree that for things such as "adding components" an internal sequence/list representation is better, but strings can pass arbitrary IPC or even ABI boundaries much easier for example. (And you wouldn't bat an eye for example when you see FQDNs like "www.google.com" passed as a string instead of as ["www","google","com"] because the string representation works pretty well.)

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

#606

Earlier quoted context omitted.

Agreed. But Hacker News should do something about all of the anti-bitcoin and anti-anti-nuclear ideologies running around in here. I don't really mind it that much but it'd be nice, it's really the only 2 extremisms I've experienced here, all other subjects are discussed in a fair manner.

I appreciate informed discussion about bitcoin & nuclear, as both topics are highly relevant to the technical, business, and hacker roots of HN. They seem distinctly different from, say, "anglocentrism" @dang was calling out.

> discussion

There's no such thing as fair discussion about those topics here.

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

#607
post #561

Earlier quoted context omitted.

> "Persistent Temp" is also an oxymoron. It's not an oxymoron to have files which are temporary but not limited in scope to a single power cycle. For example, you could have a long-running process which you want to be able to resume if it's interrupted; /var/tmp would be an appropriate place for the state. The data is temporary because it will be deleted once the process is finished, but you wouldn't want it wiped ou…

Except that the FHS says that "data stored in /var/tmp is typically deleted in a site-specific manner", and as an application vendor you have no control over that site-specific clean frequency. On all my systems, /var/tmp is a symlink to /tmp and that has never caused any issue.

The FHS is not wrong; cleaning policies are indeed site-specific and files placed in any temp directory can in principle disappear at any time. (Though, in theory, it's not supposed to happen while the files are still "in use" by running programs.) Still, historically you could count on files in /var/tmp lasting longer than files in /tmp, including across reboots.

Nothing will immediately break because you linked /var/tmp to /tmp. Whether it causes issues depends on the programs that you (or your users) run and how they make use of /var/tmp. However, if someone did have to restart a long-running process from the beginning because recent state information in /var/tmp was not preserved across a reset, I would say that is a problem with the administration of the system and not the program that stored its state there.

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

#608
post #509

Earlier quoted context omitted.

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…

I'm similar, but I would like to support labels intended for humans, along with various translations, as metadata on top of e.g. filesystem path components.

You nailed it - getting rid of spaces and dashes and underscores is extremely human-hostile. People added spaces to the English language for a reason, and that's because they make it way easier to read.

Your system is only intended for other programs to interact with? Go nuts, make hex UUIDs. Actual people are supposed to use it? You need separator characters.

I also don't see how those characters add "extra complexity" unless you're doing dumb things like text processing on paths and filenames (as opposed to using OS/library functions that handle paths correctly) - in which case, there's your problem.

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

#609
post #488

Earlier quoted context omitted.

Is your account the only account that's expected to run the binary? If so, then `$HOME/bin` is a perfectly acceptable (albeit not standard) place to put it. If you expect other users to be able to execute the program, then you should put it in either `/usr/bin` or `/usr/local/bin`, depending on whether the former is already being used by a package manager. `/opt` is generally for self-contained software that doesn't…

$HOME/.local is the equivalent if /usr/local for per-user stuff.

I don’t think there’s any “official” word on that (the XDG spec that defines ~/.local/share doesn’t mention ~/.local/{bin,lib} IIRC, and the traditional per-user entry in PATH seems to be ~/bin), but a fair number of people use it this way, yes, including me.

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

#610

Earlier quoted context omitted.

I have coworkers on Mac that write node/JS code. Every once in awhile I'd pull down the latest code and it wouldn't run. I'm on Linux. Sure enough, they had SomeFile and were importing Somefile and it works fine on Mac but not on Linux (which, of course, is what our production servers use). It amazes me that "works fine on my machine" is still a thing when I definitely worked at companies that solved this back in the…

Good news, we have solutions. You could use continuous integration and software containers like Docker.

Does Docker abstract filesystem behaviors like this? I always thought that it stopped at the libc level - that is, libc is included in the container, but it calls the host kernel's system calls, and so inherits the host kernel's behavior (including things like underlying filesystem case sensitivity).
Post reply on HN