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
481–490 of 817 posts
Re: I'm “still afraid to use spaces in file names” years old
#482Earlier quoted context omitted.
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
#483Earlier quoted context omitted.
Overly aggresive is right! I don't know if this is genius or deranged! I'm leaning towards genius and stealing the idea. By the way: what's your beef with en dashes? I mean, if it was "everything should be 'HYPHEN-MINUS' (U+002D)", then fine, but why specifically en dashes and not em dashes?
> By the way: what's your beef with en dashes? Of all the changes in that list, removing the character that doesn't appear on a standard keyboard seems like the least controversial...
It's up there with those damn angled quotes.
Re: I'm “still afraid to use spaces in file names” years old
#484Earlier quoted context omitted.
I mean we're heading there with /usr being your /System. Redhat/Pottering are doing heroic work in this space. /Users -> /home /System -> /usr /Data -> /var /Config -> /etc /Boot -> /boot /Ephemeral Temp -> /run /Persistent Temp -> /tmp The only real holdouts are proc/sys/dev which are the kernel and mnt/media/opt/srv which are really for the user/sysadmin and aren't really used by the OS anymore.
Genuine question: on what systems is `/tmp` persistent? Both macOS and Ubuntu 20.04 clear `/tmp` on every reboot for me, and I haven't changed the defaults at all.
Re: I'm “still afraid to use spaces in file names” years old
#485I 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
#486Re: I'm “still afraid to use spaces in file names” years old
#487Earlier quoted context omitted.
I mean we're heading there with /usr being your /System. Redhat/Pottering are doing heroic work in this space. /Users -> /home /System -> /usr /Data -> /var /Config -> /etc /Boot -> /boot /Ephemeral Temp -> /run /Persistent Temp -> /tmp The only real holdouts are proc/sys/dev which are the kernel and mnt/media/opt/srv which are really for the user/sysadmin and aren't really used by the OS anymore.
Genuine question: on what systems is `/tmp` persistent? Both macOS and Ubuntu 20.04 clear `/tmp` on every reboot for me, and I haven't changed the defaults at all.
Re: I'm “still afraid to use spaces in file names” years old
#488Earlier 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?
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…
Re: I'm “still afraid to use spaces in file names” years old
#489Earlier 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?
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…
Can't remember the last time I had a problem arranging this. If using autotools, which covers 95+% of stuff, it's usually a question of something like "./configure --prefix=$HOME/usr".
(If I want to share stuff between users, /usr/local/ is of course a better place. macOS is a bit more restrictive, so I have a separate user for this, whose /usr folder is readable by everybody.)
Re: I'm “still afraid to use spaces in file names” years old
#490I 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…
My Mac is formatted case sensitive when the default is case insensitive. This will also catch a ton of import related bugs. League of legends doesn’t run until I sed files for instance.
When I got a new Mac, I just gave up and acquiesced to the case-retentive world :-(