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'm “still afraid to use spaces in file names” years old
651–660 of 817 posts
Re: I'm “still afraid to use spaces in file names” years old
#652Re: I'm “still afraid to use spaces in file names” years old
#653Earlier 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.
Re: I'm “still afraid to use spaces in file names” years old
#654Earlier 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…
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
#655Re: I'm “still afraid to use spaces in file names” years old
#656Earlier 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.
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
#657Earlier 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…
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
#658Earlier 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.
Re: I'm “still afraid to use spaces in file names” years old
#659Not obeying the "Robustness Principle" in software is just poor engineering. https://en.wikipedia.org/wiki/Robustness_principle
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
#660Earlier 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…