Live data from Hacker News

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

twitter.com

651–660 of 817 posts

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

#651
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 add a Japanese character into any .py, .js and .html file to ensure that Unicode is working properly through the entire chain. Mostly in form of a variable which gets passed along, even in URL parameters.

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

#653
post #278

Earlier quoted context omitted.

Except for \Windows\System32\drivers\etc\hosts, of course.

I occasionally try to search for the reasoning behind the location of the hosts file in Windows, and I always come up blank.

https://superuser.com/questions/355297/why-does-windows-have...

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

#654
post #489

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…

I started out using $HOME/bin, but a fair amount of stuff assumes a /usr- or /usr/local-style folder structure when doing make install, so I've settled on using $HOME/usr/bin instead, so that programs can create $HOME/usr/include and $HOME/usr/share and whatever, without trampling on stuff in my home folder. Can't remember the last time I had a problem arranging this. If using autotools, which covers 95+% of stuff, i…

> $HOME/bin

On freedesktop systems there's the ~/.local directory which is supposed to be a mirror of the file system hierarchy. Seems like a good place for bin, lib, include directories.

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

#655

Earlier quoted context omitted.

GoboLinux does exactly that: https://en.m.wikipedia.org/wiki/GoboLinux

Dammit, I wanted to be the one to mention gobo linux [HN deleted my laughing emoji ffs]

Beat the system ʕ•ᴥ•ʔ

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

#656

Earlier quoted context omitted.

> thisismyconfig.txt vs this is my config.txt or this_is_my_config.txt Just wondering, what is the readability of this for people who are dyslexic?

tbh I'm not dyslexic and realized the spaces make it really difficult to know what the filename actually is. If you just take the second example, how would you know if the file was "this is my config.txt" versus "config.txt"? Aside from parsing errors it just seems to lend itself to ambiguity.

This. People are saying spaces improve ergonomics. Unless everyone always quotes their paths in documentation, emails, etc -- which they won't -- I say it actually reduces readability.

Also programs automatically that turn paths into links don't work with spaces.

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

#657
post #644
post #569

Earlier quoted context omitted.

He he. Want to see true craziness? POSIX file names are just a bag of bytes. They don't even have to be text, they can be anything (almost), there's no standard text encoding: https://lwn.net/Articles/325304/ And in typical Open Source fashion, someone actually claims it's a feature: https://lwn.net/Articles/325398/ because hey, you 99.999% percenters can suffer so that I, 0.001% percenter can implement my wacky syst…

This appears to demonstrate the full range of abuse. $ mkdir hold $ cd hold $ cat ../wildname.c #include int main(int argc, char **argv) { char n[256]; int i,j=0; FILE *fp; for(i=1; i ? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? -rwxr-xr-x. 1 luser lgroup 8464 Nov 11 16…

It's software. Software's contract is the same as a legal contract. And a legal contract mostly says what you can't do.

So anything not directly blocked by the software is allowed.

Ergo, clear specifications, strict yet flexible types and APIs, etc.

Otherwise, it's just bad design.

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

#658
post #464

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.

Could you consider rephrasing this? It sounds like an interesting observation that I'd love to understand, but I'm genuinely not able to parse it. My best guess is "change the system time to be a timezone for which, during your work hours, the other-timezone is in a different day than UTC is" - but I'm still not sure what effect that would have on CI failures.

I read that as "set your CI to run earlier in your workday so you don't get new error reports at the end of the day." Midnight UTC being 4 pm/16:00 PST.

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

#659
post #426

Not obeying the "Robustness Principle" in software is just poor engineering. https://en.wikipedia.org/wiki/Robustness_principle

Definitely applicable here. There's no way we're going to eliminate all problems with spaces etc, so why invite trouble.

I wouldn't say it's always poor engineering though, especially the 'liberal in what you accept' half.

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

#660

Earlier quoted context omitted.

Yeah, except that tells me nothing useful... The question is exactly the same: So where do I install this random binary I downloaded from the internet or compiled myself? Is it /opt, /usr/bin, /usr/local/bin, or /bin? Where do I put the dependencies I compiled for this software - /usr/lib, /usr/local/lib, /lib, /opt/lib, /opt/ /lib, or what?

The standard is, indeed, excessively vague because it was written to let many existing implementations be conformant as is, though I’d say it’s still more helpful than many other standards with that deficiency. There’s a method to it, however: - Things installed in /, if it’s different from / usr , are generally not to be touched; - Things installed in / usr are under the distro’s purview or otherwise under a package…

Thank you for the thoughtful reply, the point about netmounting shared usr makes it much easier to understand.
Post reply on HN