News for hackers. Stuff that matters.
Re:I'm “still afraid to use spaces in file names” years old by pimterry on Thursday November 11, 2021 @08:56AM (#29187838)
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 and/or special characters in it.

Forces you to deal with this properly, and immediately ensures that every automated test checks this case without you having to remember every time. Hasn't been particularly inconvenient, since I'm autocompleting it 99% of the time anyway, and I haven't shipped a single path parsing bug since.

Re:I'm “still afraid to use spaces in file names” years old by alpaca128 on Thursday November 11, 2021 @09:02AM (#29187896)
Seems like MS had the same idea according to an answer in the link:

> Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to force programmers to deal with spaces in filenames.

Re:I'm “still afraid to use spaces in file names” years old by ealexhudson on Thursday November 11, 2021 @09:15AM (#29188037)
I wish they did "User Files" instead of "Users" too, because so much software breaks on the home area having a space in it.

Not least, it makes writing scripts for various shells and getting the quoting rules right an absolute pain as well...

Re:I'm “still afraid to use spaces in file names” years old by the_mitsuhiko on Thursday November 11, 2021 @09:23AM (#29188101)
They used to. The folder was called `Documents and Settings` until Win7.
Re:I'm “still afraid to use spaces in file names” years old by 323 on Thursday November 11, 2021 @09:28AM (#29188151)
"Documents and Settings" still exists on Windows 10, as a soft link to "Users".
Re:I'm “still afraid to use spaces in file names” years old by 0des on Thursday November 11, 2021 @09:40AM (#29188272)
You know, this makes me wonder.. tangentially speaking- I wonder how hard it would be to rearrange the folder structure in linux so that I have something like this:

/Users/{root, user0, user1, ... }...

/System/{Logs, Apps/{opt, container, ...}, Temp, Conf ...}...

/Devices/{Mount, sda, sdb, null ...}...

/Boot/...

Re:I'm “still afraid to use spaces in file names” years old by selfhoster11 on Thursday November 11, 2021 @09:44AM (#29188314)
GoboLinux does exactly that: https://en.m.wikipedia.org/wiki/GoboLinux
Re:I'm “still afraid to use spaces in file names” years old by 0des on Thursday November 11, 2021 @09:55AM (#29188443)
Wow, thanks for the reply, nice find! I did some poking around on my Linux system and even re-arranging the home folder was a task of its own because the system kept trying to replace folders in their original places. I will do some digging in to Gobo and see how they're handling this. Thanks again for pointing this out.
Re:I'm “still afraid to use spaces in file names” years old by dotancohen on Thursday November 11, 2021 @11:03AM (#29189415)

  > the system kept trying to replace folders in their original places.
This is the file that you want:

  $ cat ~/.config/user-dirs.dirs 
  XDG_DESKTOP_DIR="$HOME/"
  XDG_DOWNLOAD_DIR="$HOME/Downloads"
  XDG_TEMPLATES_DIR="$HOME/"
  XDG_PUBLICSHARE_DIR="$HOME/"
  XDG_DOCUMENTS_DIR="$HOME/"
  XDG_MUSIC_DIR="$HOME/"
  XDG_PICTURES_DIR="$HOME/"
  XDG_VIDEOS_DIR="$HOME/"
Re:I'm “still afraid to use spaces in file names” years old by yjftsjthsd-h on Thursday November 11, 2021 @11:47AM (#29190042)
That helps, but be warned that there are still programs running around that just hardcode their paths
Re:I'm “still afraid to use spaces in file names” years old by kaba0 on Thursday November 11, 2021 @01:42PM (#29191412)
Cries in nixpkgs

(Anyone who tried to package a program that hardcodes the “usual” binary paths know the pain)

Re:I'm “still afraid to use spaces in file names” years old by account42 on Friday November 12, 2021 @04:10AM (#29197498)
Doesn't nix itself hardcode the nix store path though?
Re:I'm “still afraid to use spaces in file names” years old by kaba0 on Friday November 12, 2021 @05:57AM (#29198052)
Afaik there is an option to change it, but it is not advisable as that will break the binary cache and you are left with compiling everything yourself. This is due to a technical limitation in that different packages can contain paths everywhere and thus they are inherently part of the resulting hash, on which other packages can depend.
Re:I'm “still afraid to use spaces in file names” years old by lostlogin on Thursday November 11, 2021 @12:04PM (#29190270)
You’re clearly a more capable user than me, but even so, take care. The time I accidentally moved /etc has scarred me for life.
Re:I'm “still afraid to use spaces in file names” years old by tech2 on Thursday November 11, 2021 @01:38PM (#29191359)
Early on in my Linux-using-life I made the mistake of deleting /etc. That was a learning experience like no other :)
Re:I'm “still afraid to use spaces in file names” years old by mixmastamyk on Thursday November 11, 2021 @02:16PM (#29191906)
Since Live CDs/Flash drives were invented, I wouldn't worry about this stuff any longer. Certainly have your personal files in a centralized location and backed up first.

Probably the easiest way to experiment these days is to create a VM and make snapshot, then start knocking down walls, just to see when and where the house collapses. Then revert and try something new.

Re:I'm “still afraid to use spaces in file names” years old by genewitch on Thursday November 11, 2021 @03:36PM (#29192811)
There's a computer game that deletes random files when you make a mistake or lose.

There could be a competition!

Re:I'm “still afraid to use spaces in file names” years old by simonblack on Thursday November 11, 2021 @06:41PM (#29194701)
A couple of weeks after moving to UNIX from MSDOS, I thought I'd remove lots of unnecessary 'dot-directories' from the /tmp directory. I was root as I had no concept of being a 'normal user'.

So I ran two simple commands:

     cd /tmp
     rm -fr .*
and wondered why it was taking so long. <grin>
Re:I'm “still afraid to use spaces in file names” years old by account42 on Friday November 12, 2021 @04:15AM (#29197521)
At least that doesn't happen today anymore. From bash:

> When a pattern is used for pathname expansion, the character ``.'' at the start of a name or immediately following a slash must be matched explicitly, unless the shell option dotglob is set. The filenames ``.'' and ``..'' must always be matched explicitly, even if dotglob is set.

Re:I'm “still afraid to use spaces in file names” years old by acquacow on Friday November 12, 2021 @07:56AM (#29198829)
I did that on my NAS a few years ago. I had copied in a bunch of directories from a mac and they all had tons of dot files in each dir that were showing up on my windows machines. I popped open a terminal and did the exact same thing and wiped most of the NAS out =P Good thing I had it mirrored with my other synology.
Re:I'm “still afraid to use spaces in file names” years old by gavinray on Thursday November 11, 2021 @10:56AM (#29189316)
How do you deal with lack of being able to just point to "/usr/lib/include" or other things when saying "here's my directory of shared libs"?

This is definitely interesting though, and an improvement I would say

Re:I'm “still afraid to use spaces in file names” years old by JonathonW on Thursday November 11, 2021 @11:25AM (#29189740)
GoboLinux symlinks everything into an FHS-ish structure under /System/Index/ so you still have a single place where binaries/libraries/includes/etc. live. (There are also symlinks from /usr/lib, /usr/bin, and others into /System/Index/ for compatibility with programs where those might be hardcoded.)
Re:I'm “still afraid to use spaces in file names” years old by short12 on Thursday November 11, 2021 @12:25PM (#29190533)
That actually seems like some low hanging fruit to go on a commit spree correcting code that hard codes paths
Re:I'm “still afraid to use spaces in file names” years old by oblio on Thursday November 11, 2021 @02:29PM (#29192062)
GoboLinux is old enough to vote in most countries.

So either those low hanging fruits are higher than they seem, or we're all just a bunch of dwarves.

My bet is on the second option.

Re:I'm “still afraid to use spaces in file names” years old by matheusmoreira on Thursday November 11, 2021 @05:38PM (#29194176)
It is low hanging fruit as far as the software is concerned. Simply parameterize all paths.

Will upstream accept such patches though? Sounds unlikely to me.

Re:I'm “still afraid to use spaces in file names” years old by DarkWiiPlayer on Thursday November 11, 2021 @10:28AM (#29188876)
Dammit, I wanted to be the one to mention gobo linux [HN deleted my laughing emoji ffs]
Re:I'm “still afraid to use spaces in file names” years old by andai on Thursday November 11, 2021 @05:47PM (#29194253)
Beat the system ʕ•ᴥ•ʔ
Re:I'm “still afraid to use spaces in file names” years old by abdusco on Thursday November 11, 2021 @10:36AM (#29189032)
This is what I want from Linux. Sensible & guessable names for newcomers to figure out where to put files and programs.

It's frustrating having to spend time to decide whether I should install a program in /var or /opt or /usr. What do they even mean!

So, I disagree with this convention altogether and use /apps or ~/apps now.

Re:I'm “still afraid to use spaces in file names” years old by chasil on Thursday November 11, 2021 @12:27PM (#29190551)
Oh, my young friend, you have no idea what POSIX has done to you.

"While no one sane would put newlines in directory names, such corruption of the results could lead to exploitable vulnerabilities in scripts."

http://www.etalabs.net/sh_tricks.html

Re:I'm “still afraid to use spaces in file names” years old by oblio on Thursday November 11, 2021 @02:57PM (#29192390)
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 system.

https://xkcd.com/1172/

Re:I'm “still afraid to use spaces in file names” years old by chasil on Thursday November 11, 2021 @05:35PM (#29194147)
This appears to demonstrate the full range of abuse.

    $ mkdir hold
    $ cd hold

    $ cat ../wildname.c 
    #include <stdio.h>
    int main(int argc, char **argv)
    { char n[256]; int i,j=0; FILE *fp;

      for(i=1; i<256; i++) if(i!=47) n[j++] = i; n[j] = 0;
      if(fp = fopen(n, "w")) { fprintf(fp, "hello world!"); fclose(fp); }
    }

    $ cc ../wildname.c 
    $ ./a.out

    $ ls -l
    total 16
    -rw-r--r--. 1 luser lgroup   12 Nov 11 16:32 ??????????????????????????????? !"#$%&'()*+,-.0123456789:;<=>? 
 
 
 @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

    -rwxr-xr-x. 1 luser lgroup 8464 Nov 11 16:32 a.out
Just because you can do something does not mean that you should.
Re:I'm “still afraid to use spaces in file names” years old by oblio on Thursday November 11, 2021 @06:02PM (#29194375)
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 by ygra on Saturday November 13, 2021 @02:24AM (#29208077)
It's basically the same on Windows with NTFS. Just a bag of 16-bit words instead of bytes.
Re:I'm “still afraid to use spaces in file names” years old by 0des on Thursday November 11, 2021 @10:42AM (#29189116)
Re:I'm “still afraid to use spaces in file names” years old by somehnguy on Thursday November 11, 2021 @11:16AM (#29189613)
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, as long as that place is the 'right' place. There are too many 'right' places which makes it hard to find random things at a later date or when on a box you're not super familiar with. It's also a complete waste of time to think about it at all.

Re:I'm “still afraid to use spaces in file names” years old by NavinF on Thursday November 11, 2021 @12:59PM (#29190902)
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.

Re:I'm “still afraid to use spaces in file names” years old by stryan on Thursday November 11, 2021 @05:19PM (#29193974)
> 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.

The FHS, does actually answer both of of those questions. Files inside /etc/ should be grouped in subdirectories[0] andd the HTTP server should serve user-specified website files from /srv[1] and normal distro-provided files (such as the apache test page) from /var[2].

[0]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s07.htm...

[1]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s17.htm...

[2]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05.html#p...

Re:I'm “still afraid to use spaces in file names” years old by elevader on Friday November 12, 2021 @06:30AM (#29198236)
"use subdirectories" is probably the most handwavey answer possible, aside from maybe "just put it somewhere, lol". I feel like the standard could provide some sort of guidance on how to name folders or something.
Re:I'm “still afraid to use spaces in file names” years old by NavinF on Friday November 12, 2021 @10:13PM (#29207063)
> HTTP server should serve user-specified website files from /srv

I’ve never seen that in my life, but I’m sure someone does that. This is one of those cases where the people who follow the standard are increasing fragmentation

Re:I'm “still afraid to use spaces in file names” years old by graycat on Friday November 12, 2021 @06:28AM (#29198222)
> 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.

So, given some data, say a file and/or directory, maybe from saving a Web page, that is relevant to subjects A, K, T, and Z, where in the file system directory trees to put that data?

My solution: Put the data in a directory for one of the subjects A, K, T, or Z without thinking very hard about which of these. Then go to a file I call FACTS.DAT (right, an old idea with an old 8.3 file name!). I maintain that file with a few, simple editor macros. So, sure, the file is a catch-all for entries of random short facts. And each entry starts with a time-date stamp and a list of key words. So, in the case of subjects A, K, T, or Z, include the key words appropriate for each of those. Then in the body of the entry, put the tree name of the file/directory where did store the data.

In a few seconds with my favorite text editor I can append an entry or search for an entry.

So far this year I have put 686 entries in the file FACTS.DAT for about 2.1 entries per day. For anything like current personal computers, handling such a file is trivial.

The idea works great!

Re:I'm “still afraid to use spaces in file names” years old by emteycz on Thursday November 11, 2021 @10:53AM (#29189286)
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/<app name>/lib, or what?
Re:I'm “still afraid to use spaces in file names” years old by aranchelk on Thursday November 11, 2021 @11:27AM (#29189782)
I was taught /usr/local/bin

/opt is for standalone packages, so if it’s a single file, no.

/bin is only for stuff needed on single user mode, so probably not (unless that’s what the binary is for.

/usr/bin is going to typically contain files installed by your package manager and should probably be left unaltered by human hands.

The deps I would assume /usr/local/lib but it hasn’t ever come up for me.

Re:I'm “still afraid to use spaces in file names” years old by krinchan on Thursday November 11, 2021 @06:13PM (#29194461)
Fun fact: Debian is working towards[1] and Arch already has merged / and /usr. /bin is a soft link to /usr/bin and similarly with sbin and lib.

[1]: https://wiki.debian.org/UsrMerge

Re:I'm “still afraid to use spaces in file names” years old by nsv on Thursday November 11, 2021 @11:32AM (#29189846)
To add: when you install software yourself you choose this, when your install software from e.g. a distribution package it is chosen by the package maintainers, and to a larger extent the maintainers of the distribution.

This is one of the big advantages of using a pre-made advantages of using a ready-made Linux distribution: beyond the convenience of having an installer or easy to install packages, you get some assurance that the system as a whole has been thoughtfully put together.

Arch Linux for example symlinks /bin and /sbin to /usr/bin and /lib to /usr/lib among other things.

Re:I'm “still afraid to use spaces in file names” years old by woodruffw on Thursday November 11, 2021 @12:20PM (#29190466)
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 play nicely with the rest of the system, but might still be installable through the default package manager.

Re:I'm “still afraid to use spaces in file names” years old by megous on Thursday November 11, 2021 @01:05PM (#29190985)
$HOME/.local is the equivalent if /usr/local for per-user stuff.
Re:I'm “still afraid to use spaces in file names” years old by mananaysiempre on Thursday November 11, 2021 @04:35PM (#29193501)
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 by tom_ on Thursday November 11, 2021 @01:07PM (#29190997)
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, 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 by matheusmoreira on Thursday November 11, 2021 @05:46PM (#29194246)
> $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 by woodruffw on Thursday November 11, 2021 @01:23PM (#29191170)
Yeah, it definitely gets hairier when using anything that's more than just a drop-in binary.
Re:I'm “still afraid to use spaces in file names” years old by sergeykish on Friday November 12, 2021 @07:50AM (#29198802)
Follow your distribution. For example Arch Linux provides PKGBUILDs for official repos and AUR. Most of the time someone has already published PKGBUILD, but if not I just patch accordingly.

And conditions that formed separation are long gone, Arch Linux symlinks most of it:

    /bin -> /usr/bin
    /sbin -> /usr/bin
    /usr/sbin -> /usr/bin

    /lib -> /usr/lib
    /lib64 -> /usr/lib
    /usr/lib64 -> /usr/lib
Re:I'm “still afraid to use spaces in file names” years old by mananaysiempre on Thursday November 11, 2021 @03:54PM (#29193032)
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 manager, any modifications are on pain of confusing it;

- Things installed in /usr/local are under the admin’s purview and unmanaged one-offs, there are always some but overuse will lead to anarchy;

- Things installed in /opt are for whatever is so foreign and hopeless in not conforming to the usual factoring that you just give up and put it in its own little padded cell (hello, Mathematica);

- Everything is generally configured using files in /etc, possibly with the exception of some of the special snowflakes in /opt; the package manager will put config files meant to be edited there and expect the admin to merge any changes in manually, and sometimes put default settings meant to be overridden by them in /usr/share (see below)—both approaches can be problematic, but the difficulty is with migrating configuration in general, not the FHS as such.

There used to be additional hierarchies like /usr/X11R6, and even a /usr/etc on some (non-Linux?) systems, but AFAIU everyone agrees their existence makes no sense (anymore?), so much that even FHS doesn’t lower itself to permitting them.

The distinction between / and /usr might appear to be pointless as well, and nowadays it might be (some distros symlink them together), but previously (especially before initial ramdisks were widespread) stuff in / was whatever was needed to bring up the system enough that it could netmount a shared /usr.

Inside each of /, /usr and /usr/local there is bin for things that are supposed to be directly executable, whether binary or a script and all in a single place; share and lib for other portable and non-portable (usually but not necessarily text and binary) shared files, respectively, segregated by application or purpose; finally, due to the dominance of C ABIs and APIs on Unices, the top level of lib also hosts C and C++ library files and there’s an additional directory called include for the headers required to use them. Some people also felt that putting auxiliary executables (things like cc1, the first pass of the C compiler) inside lib was awkward so they created libexec for that purpose, but I don’t think the distinction turned out to be particularly useful so not all distros maintain it.

That’s it, basically. There are subtler but logical points (files vs subdiretories in /etc) and things people haven’t found an obviously superior solution for (multilib and cross environments), and I made no attempt to be historically accurate (the original separation of / and /usr happened for intensely silly reasons), but those are the fundamental principles of the system, and I feel it does make sense as a coherent implementation of a particular design. Other designs are possible (separation by application or package not purpose, Plan 9-ish overlays, NixOS’s isolated environments), but that’s a discussion on a different level; the point is that this one is at the very least internally consistent.

Re the unfriendly names ... I honestly don’t know. Newbie-friendliness matters, but it’s not the only thing that does; particularly in a system intended for interactive text-mode use, concise names have a quality of their own. There’s a reason I’m more willing to reach for curl and jq rather than for httpx and lxml, for regular expressions rather than for Parsec, and even for cmd.exe, as miserable as it is, rather than for PowerShell.

I feel weird that no HCI people seem to have seriously considered the tension between interactive and programmatic environments and what the text-mode user’s experience in Unix says about it, but even Tcl, which is in many ways a Bourne shell done right, loses something in casual REPL use when it eliminates (as far as idiomatic libraries are concerned) short switches. Coming up with things like rsync -avz or objdump -Ctsr is not very pleasant initially, but I certainly wouldn’t want to type out the longhand form that would be the only possible one in most programming languages (even if I find their syntax beautiful, e.g. Smalltalk/Self).

Re:I'm “still afraid to use spaces in file names” years old by nobody9999 on Friday November 12, 2021 @02:45AM (#29197164)
>the original separation of / and /usr happened for intensely silly reasons

As I recall, there were very good reasons for separating / and /usr (as well as /home and /var). The biggest one was that various Unix kernels would panic[0] if / was full. But that issue was almost universally fixed by 1990 or so.

And netmounts of pretty much everything other than / were pretty common for many years, due to the high cost of storage.

So no, the reasons weren't silly, they just don't apply to more modern systems.

[0] https://en.wikipedia.org/wiki/Kernel_panic

Re:I'm “still afraid to use spaces in file names” years old by mananaysiempre on Friday November 12, 2021 @08:00AM (#29198854)
OK, I didn’t put this completely correctly. The original separation of /usr to hold user home directories (!) and / to hold everything else was because the first RK05 disk ran out, but it makes sense in any case. The additional hierarchy under /usr was created some time later when space on the first RK05 disk ran out again, and while this can be a perfectly sensible decision for a single installation on a single site, taking it seriously decades later is silly. Neither does that mean that there weren’t good reasons the split got preserved in subsequent systems, just that they couldn’t have been the same as the original ones; there are no netmounts in V6, after all.

(I have an old Unix intro book that describes /usr as user home directories, the rest is a second-hand retelling[1].)

[1] http://lists.busybox.net/pipermail/busybox/2010-December/074...

Re:I'm “still afraid to use spaces in file names” years old by nobody9999 on Friday November 12, 2021 @11:54AM (#29201497)
Interesting stuff. Thanks for sharing it!
Re:I'm “still afraid to use spaces in file names” years old by emteycz on Thursday November 11, 2021 @06:08PM (#29194425)
Thank you for the thoughtful reply, the point about netmounting shared usr makes it much easier to understand.
Re:I'm “still afraid to use spaces in file names” years old by graycat on Friday November 12, 2021 @06:30AM (#29198237)
Where?

See my post to this thread at

https://news.ycombinator.com/item?id=29198222

Re:I'm “still afraid to use spaces in file names” years old by matheusmoreira on Thursday November 11, 2021 @05:42PM (#29194206)
> So where do I install this random binary I downloaded from the internet or compiled myself?

In your home directory.

Re:I'm “still afraid to use spaces in file names” years old by db48x on Thursday November 11, 2021 @10:57AM (#29189344)
Wherever you want. All of the above, or none. It really is up to you.
Re:I'm “still afraid to use spaces in file names” years old by emteycz on Thursday November 11, 2021 @10:58AM (#29189357)
That's exactly the problem. This leads to mess. The Windows model of C:\Program Files\<app name> is much better.
Re:I'm “still afraid to use spaces in file names” years old by tremon on Thursday November 11, 2021 @02:40PM (#29192185)
But why are many Windows programs under C:\Windows\System32 then, if Windows has only a single model? Why aren't all Steam-provided (for example) games in a single location? Or, if they are, does Windows really have a single model?

Yes, the Linux/POSIX model is confusing, but the split is to segregate administrative domains:

- / and /usr are the domain of the distribution. As a user, you should never install there. The administrative group is root.

- /usr/local is the domain of the machine admin. If the machine is yours to manage, you can install software there. The administrative group is staff.

- /opt/$vendor is the domain of third-party vendors. Each vendor (like Steam, Eclipse, Arduino Studio) can get its own subdirectory and its own administrative user group.

How would you achieve the same on Windows? How do you make sure the Adobe updater can only install new versions of CS, but not surreptitiously install a new (free!) spyware package under C:\Windows? How would you allow certain power users to share one Google Chrome installation, allow each of them to update it, but not let them install additional software system-wide?

Re:I'm “still afraid to use spaces in file names” years old by drewzero1 on Thursday November 11, 2021 @11:33AM (#29189865)
Okay, but what about ProgramData? I have enough programs that put their junk in there instead of Program Files, and others that make their own directories on the root of the drive (driver installers are really bad about this).

I think the best model I've seen for consistent binary locations is the 'Applications' folder in Mac OS X, but it fails as well by retaining the /usr/bin elsewhere.

Re:I'm “still afraid to use spaces in file names” years old by yjftsjthsd-h on Thursday November 11, 2021 @11:50AM (#29190093)
When you download a portable app (just a bare .exe), do you make a folder for it and drop it in program files? (quite possible, you'd just be unusual) If not, why does Windows get a free pass?
Re:I'm “still afraid to use spaces in file names” years old by Shared404 on Friday November 12, 2021 @12:08AM (#29196469)
Except instead of config files, Windows has the registry.

Also, as mentioned by the siblings to thia comment, the 'mess' has a purpose, and is less messy than it appears.

Want to manually install something? Into /usr/local it goes. Done.

The only way to handle this that I've been really impressed with is Mac's "Applications" folder. Unfortunately, I dislike most other things about Mac.

Re:I'm “still afraid to use spaces in file names” years old by db48x on Thursday November 11, 2021 @11:02AM (#29189407)
No, it frees you to pick whatever unmessy solution you want.

You can do `configure --prefix=/Program\ Files/<app>` if you want.

Re:I'm “still afraid to use spaces in file names” years old by emteycz on Thursday November 11, 2021 @11:10AM (#29189524)
If I am not writing all of my installation scripts by hand, because that would be really intense, then every folder gets filled with random bits of software.

Offering too many similar choices leads to mess. There's nothing fundamentally different between using one or more of these options and using the only option, except that in the second case there isn't any opportunity to make mess.

> You can do `configure --prefix=/Program\ Files/<app>` if you want.

Thanks for the tip! Can't do that with distro repo software though :-/

Re:I'm “still afraid to use spaces in file names” years old by kevin_thibedeau on Thursday November 11, 2021 @02:30PM (#29192072)
Use Gnu Stow to keep the random bits contained in their own app directory that is symlinked into the /usr/local tree. Then you can manage everything without leaving orphan files behind.
Re:I'm “still afraid to use spaces in file names” years old by emteycz on Thursday November 11, 2021 @06:13PM (#29194463)
Very cool
Re:I'm “still afraid to use spaces in file names” years old by db48x on Thursday November 11, 2021 @11:24AM (#29189730)
> then every folder gets filled with random bits of software.

What does that even mean? When you install something, you put it where you want it.

If you don’t like where your distribution puts files, choose a different one. Not all of them use the same convention.

Re:I'm “still afraid to use spaces in file names” years old by emteycz on Thursday November 11, 2021 @11:38AM (#29189927)
All (except aforementioned GoboLinux) use FHS.
Re:I'm “still afraid to use spaces in file names” years old by LordDragonfang on Thursday November 11, 2021 @02:49PM (#29192277)
I feel like it just highlights the problem of how antiquated and confusing linux terminology that so many of those reference "single-user mode", used to refer to booting into root, when the vast majority of computing devices a given user will interact with only have a single actual user, making this a confusing and almost meaningless distinction to someone not already intimate familiar with linux.
Re:I'm “still afraid to use spaces in file names” years old by tenebrisalietum on Thursday November 11, 2021 @05:02PM (#29193764)
The directories that house your executables are read only to users other than root, to prevent attacks and overwriting them by non-root users.

/var stands for variable data--like log files, cache directories, spool directories, etc. You shouldn't put executables there. Ideally you should be able to set the noexec flag on it.

`/usr` actually exists because the original UNIX developers ran out of disk space and had to attach another disk. The difference between /bin and /usr/bin is not worth it and even Debian symlinks /usr/bin to bin.

But your distribution's package manager should be putting stuff in /bin or /usr/bin, not you. Anything that follows the regex "{asterisk}/local{asterisk}" is something the system owner can do whatever with. So you should be using /usr/local/bin or $HOME/local/bin. I don't know why there's no /local off of the root. (One thing I do on my own systems is make and use an /etc/local although I think you're supposed to use something like /usr/local/etc).

/opt is for third party programs that aren't installed via your distro's package manager.

If you do this, any customizations you make to a system can be easily backed up by copying all dirs with local in the name.

There's multiple decades of tradition behind these names, but they do date back to the age where actual teletypes were used.

Re:I'm “still afraid to use spaces in file names” years old by Spivak on Thursday November 11, 2021 @10:35AM (#29189015)
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.
Re:I'm “still afraid to use spaces in file names” years old by woodruffw on Thursday November 11, 2021 @12:21PM (#29190480)
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 by nybble41 on Thursday November 11, 2021 @01:10PM (#29191041)
Right, /var/tmp is the "Persistent Temp" directory, and /tmp is "Ephemeral Temp". The /run directory is for runtime data such as PID files, Unix sockets, named FIFOs, and generated systemd units—it has a specific internal structure and shouldn't be used as a direct alternative to the relatively unstructured /tmp directory. While both are generally ephemeral tmpfs mounts, only /tmp is writable to all users.
Re:I'm “still afraid to use spaces in file names” years old by mike_hock on Thursday November 11, 2021 @01:08PM (#29191005)
"Persistent Temp" should be /var/tmp. "Persistent Temp" is also an oxymoron.
Re:I'm “still afraid to use spaces in file names” years old by nybble41 on Thursday November 11, 2021 @01:17PM (#29191112)
> "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 out by a system reset. Generally /tmp is cleared at every reset, and is often a tmpfs mount, while files in /var/tmp are automatically cleaned up only when they reach a certain age.

Re:I'm “still afraid to use spaces in file names” years old by tremon on Thursday November 11, 2021 @02:44PM (#29192225)
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.
Re:I'm “still afraid to use spaces in file names” years old by nybble41 on Thursday November 11, 2021 @04:30PM (#29193445)
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 by Spivak on Thursday November 11, 2021 @01:22PM (#29191164)
Basically no one uses /var/tmp for anything (and nobody should either). World writable directories are a mistake and only continue to exist because apps assume they are available.

/tmp and friends are poorly named. They really should be /shared or /dmz or /freeforall or something.

* If you need service-specific tmp space use RuntimeDirectory or PrivateTmp if your app is hardcoded to /tmp.

* If you need service-specific persistent data that goes in /var/lib/your-app.

* If you need temp space for your user it's at /var/run/user/your-uid.

* If you need more than one user/service to share files but not everyone then god have mercy on your soul because all options are bad. There sure are a lot of them but none of them are at all satisfying.

Re:I'm “still afraid to use spaces in file names” years old by account42 on Friday November 12, 2021 @06:32AM (#29198248)
> Basically no one uses /var/tmp for anything

Gentoo does, at least by default: https://wiki.gentoo.org/wiki//etc/portage/make.conf#PORTAGE_...

Re:I'm “still afraid to use spaces in file names” years old by earthboundkid on Thursday November 11, 2021 @01:03PM (#29190958)
All storage is temporary. You just gotta wait long enough.
Re:I'm “still afraid to use spaces in file names” years old by novok on Thursday November 11, 2021 @01:05PM (#29190973)
People don't reboot often. Persistent tmp basically means it will be cleared in an infrequent manner, so the likelihood of it going away 1s after you release your file handle is low.
Re:I'm “still afraid to use spaces in file names” years old by carlhjerpe on Thursday November 11, 2021 @03:58PM (#29193086)
I'm not sure I'm a fan of the capitalization and spaces, other than that I'm all for more self-explanatory names.
Re:I'm “still afraid to use spaces in file names” years old by johnlorentzson on Friday November 12, 2021 @06:09AM (#29198108)
Why not? That's how proper English text is written. Of course there are many programs that can't handle it properly (or handles it inconveniently) so in practice it might be problematic at times, but otherwise I see nothing wrong with it.
Re:I'm “still afraid to use spaces in file names” years old by xeyownt on Friday November 12, 2021 @08:24AM (#29199022)
Why compare with English? It's computer domain, it's not a book or a poem. It should be clear and unambiguous.

Caps are annoying to type, and difficult to remember (Do You Caps, or Do you caps, or DO YOU CAPS, etc).

Spaces are nuisances that bring no benefit. At best we should use non-breaking space for filenames, but that would be even more atrocious.

Re:I'm “still afraid to use spaces in file names” years old by carlhjerpe on Friday November 12, 2021 @06:24AM (#29198193)
Generally just because typing it out with tab completion in zsh sucks, and I don't see a good solution (if it was solved nicely it'd be solved already)
Re:I'm “still afraid to use spaces in file names” years old by anyfoo on Thursday November 11, 2021 @04:15PM (#29193271)
Is it coincidence that you almost exactly replicated what macOS has? Except that /Devices is /Volumes, .../Apps is .../Applications. and /Boot is handled differently.

Of course, that's not perfect either, because a) decades of changes vs. compatibility have made it less clean in certain places, and b) pretty much all the POSIX paths still exist for unix-y compatibility, but overall it's like that.

Re:I'm “still afraid to use spaces in file names” years old by matheusmoreira on Thursday November 11, 2021 @05:23PM (#29194028)
> I wonder how hard it would be to rearrange the folder structure in linux

Restructuring the directories is the easy part. You just delete the old tree and make a new one. You can also mount procfs and sysfs wherever you want.

The hard part is modifying existing software to work with the new tree. So many programs assume you have a "standard" file system tree. So many programs assume procfs is mounted at /proc. So many programs have hardcoded paths. Shared library locationd can become part of the binaries when they're compiled. It's insane and you'd essentially be creating a new Linux distribution.

Re:I'm “still afraid to use spaces in file names” years old by biryani_chicken on Thursday November 11, 2021 @11:32AM (#29189852)
You don't even need to rearrange the folders themselves, just show them like that in the file explorer. Same way the windows explorer does.
Re:I'm “still afraid to use spaces in file names” years old by post-it on Thursday November 11, 2021 @01:21PM (#29191151)
MacOS too. /usr/ and /dev/ and whatnot exist, they're just flagged as invisible in Finder. There's a command to globally unhide them for those who want to see them.
Re:I'm “still afraid to use spaces in file names” years old by 0des on Thursday November 11, 2021 @12:07PM (#29190304)
Do you have any docs on how to do that? Thanks for the reply, I look forward to trying that.
Re:I'm “still afraid to use spaces in file names” years old by riccardomc on Thursday November 11, 2021 @03:37PM (#29192829)
Why not just symlink them? You can have best of both worlds with relatively little effort.

Make the overlay of your dreams!

Re:I'm “still afraid to use spaces in file names” years old by caymanjim on Thursday November 11, 2021 @09:57AM (#29188471)
You monster!
Re:I'm “still afraid to use spaces in file names” years old by 0des on Thursday November 11, 2021 @09:59AM (#29188490)
Don't even get me started on /usr/local/bin..
Re:I'm “still afraid to use spaces in file names” years old by ThaJay on Thursday November 11, 2021 @10:50AM (#29189235)
You mean "Start Menu"?
Re:I'm “still afraid to use spaces in file names” years old by e0a74c on Thursday November 11, 2021 @04:55PM (#29193694)
Couldn't you do it with plain old symlinks?
Re:I'm “still afraid to use spaces in file names” years old by Bad_CRC on Thursday November 11, 2021 @10:29AM (#29188903)
macos does something like that.
Re:I'm “still afraid to use spaces in file names” years old by thedday on Thursday November 11, 2021 @12:07PM (#29190307)
Yeah, it's a junction point, but it's also useless. Open a command box and CD to it; now what? A file explorer and set it as the directory, again, now what?
Re:I'm “still afraid to use spaces in file names” years old by sixothree on Thursday November 11, 2021 @11:09AM (#29189504)
I know this is completely tangential. But you can Win-R and just type Documents and it will load your documents folder. Same for downloads, pictures, temp (windows temp), and I'm sure many others.

Works from File-Open dialogs and address bars and even in the command prompt you can even do "explorer documents".

Re:I'm “still afraid to use spaces in file names” years old by WalterBright on Thursday November 11, 2021 @08:12PM (#29195266)
Nothing says progress like renaming all your paths.
Re:I'm “still afraid to use spaces in file names” years old by gary_0 on Friday November 12, 2021 @12:48AM (#29196637)
In the Win95 era, it was "C:\My Documents".
Re:I'm “still afraid to use spaces in file names” years old by grishka on Thursday November 11, 2021 @10:08AM (#29188615)
Huh, spaces. There's way too much software, especially on Windows, that breaks when there are Cyrillic characters in a path. I'll let you guess how I found out.
Re:I'm “still afraid to use spaces in file names” years old by DnDGrognard on Thursday November 11, 2021 @11:41AM (#29189979)
I had a really odd one last year where a Grave I ( well known brand name) got converted by office/excell into a Double Grave I.

The double grave I is used by some obscure orthodox religionious texts

Re:I'm “still afraid to use spaces in file names” years old by DarkWiiPlayer on Thursday November 11, 2021 @10:29AM (#29188899)
A friend had the username "Rubén" and jfc it broke everything other than windows itself xD
Re:I'm “still afraid to use spaces in file names” years old by dhosek on Thursday November 11, 2021 @10:40AM (#29189091)
The problem isn't the Cyrillic or the é but the fact that Windows lets you put those characters in file names in non-Unicode encodings which will create sequences of bytes which are invalid UTF-8. It's 2021, FFS, stop using legacy encodings.
Re:I'm “still afraid to use spaces in file names” years old by grishka on Thursday November 11, 2021 @11:07AM (#29189474)
All win32 functions that accept or return strings come in two varieties, with A and W suffixes, MessageBoxA/MessageBoxW. The A works with the system default 8-bit encoding (cp1251 in case of Cyrillic), the W works with unicode in wide chars. There shouldn't be much of a problem with string handling if you stick exclusively with W functions.
Re:I'm “still afraid to use spaces in file names” years old by ziml77 on Thursday November 11, 2021 @11:35AM (#29189895)
Using the W functions has been the advice from Microsoft's documentation for ages. But people still use the A functions because they're easier, especially when writing cross-platform software since Windows is the only major OS that made the unfortunate choice of having the base character type 16 bits wide.

Fortunately the future of the Windows API does look better since Microsoft has now added proper UTF-8 support since Win 10 1904. All you have to do is request it in the application manifest and the A functions will accept and return UTF-8.

Re:I'm “still afraid to use spaces in file names” years old by grishka on Thursday November 11, 2021 @01:29PM (#29191264)
> since Windows is the only major OS that made the unfortunate choice of having the base character type 16 bits wide

Apple OSes use something they call "unichar" inside NSStrings. I'm not 100% sure what it is, but it feels like it's the same 16-bit wide character.

Re:I'm “still afraid to use spaces in file names” years old by ziml77 on Thursday November 11, 2021 @03:20PM (#29192639)
It's possible! It seemed like a sensible choice back in the early 90s when the answer to making a system for global use was UCS-2. I know Java was another one that went with that decision.
Re:I'm “still afraid to use spaces in file names” years old by mjevans on Thursday November 11, 2021 @01:13PM (#29191071)
I would rather they added a U suffixed version and better still backported that all the way to Win 7. Now in 3-7 years people can write programs that use the A functions, but have to check the version of Windows and refuse to run if it isn't new enough.
Re:I'm “still afraid to use spaces in file names” years old by colejohnson66 on Thursday November 11, 2021 @06:19PM (#29194503)
There’s been some talk of repurposing the A variants to work on UTF-8
Re:I'm “still afraid to use spaces in file names” years old by account42 on Friday November 12, 2021 @06:37AM (#29198272)
> All you have to do is request it in the application manifest and the A functions will accept and return UTF-8.

They really should have gone with WTF-8 [0] since the W functions generally accept WTF-16 and not just the valid UTF-16 subset.

[0] https://simonsapin.github.io/wtf-8/

Re:I'm “still afraid to use spaces in file names” years old by kaba0 on Thursday November 11, 2021 @01:41PM (#29191399)
If you have a username with your full name (plus point if you have special characters in your name), you will get the whole deal with shitty programs. I’m not sure if it’s me, but there were cases I simply could not use a program installed in such a location, to the point where at my previous (admittedly shitty) workplace, we often installed software in a root location…
Re:I'm “still afraid to use spaces in file names” years old by 323 on Thursday November 11, 2021 @09:19AM (#29188065)
Laughs in C:\PROGRA~1\ (try it, still works in Windows 10)
Re:I'm “still afraid to use spaces in file names” years old by Someone on Thursday November 11, 2021 @10:29AM (#29188893)
Apart from what others mentioned, that can only work if the file system automatically creates 8.3 names. NTFS does not necessarily do that (https://docs.microsoft.com/en-us/windows-server/administrati...)
Re:I'm “still afraid to use spaces in file names” years old by the_mitsuhiko on Thursday November 11, 2021 @09:24AM (#29188112)
There is no guarantee that the short name has that. In fact on a lot of German Windows installations it was PROGRA~2.
Re:I'm “still afraid to use spaces in file names” years old by 323 on Thursday November 11, 2021 @09:25AM (#29188122)
Well, on my disk PROGRA~1 is "Program Files" and PROGRA~2 is "Program Files (x86)", so still works :)
Re:I'm “still afraid to use spaces in file names” years old by floatingatoll on Thursday November 11, 2021 @09:34AM (#29188208)
That order is not guaranteed consistent across installations, however.
Re:I'm “still afraid to use spaces in file names” years old by marginalia_nu on Thursday November 11, 2021 @10:06AM (#29188589)
I wonder if code to this effect has ever been written before

  for (int i = 1; i < INT_MAX; i++) {
    if (dirExists("C:\\PROGRA~%d\\ProgramName", i)) {
Re:I'm “still afraid to use spaces in file names” years old by gmfawcett on Thursday November 11, 2021 @10:28AM (#29188883)
And that, children, is when marginalia_nu unlocked the seventh circle of the inferno. Tomorrow we'll read the story of how our new demon overlords forced us all back to Windows 3.1.
Re:I'm “still afraid to use spaces in file names” years old by jagged-chisel on Thursday November 11, 2021 @11:00AM (#29189379)
Win 3.1? on DOS 6.22? Actually, this sounds like heaven. Just don't put it on the public 'tubes.
Re:I'm “still afraid to use spaces in file names” years old by floatingatoll on Thursday November 11, 2021 @11:21AM (#29189686)
Or do. Can’t hack a Mac Classic web server!
Re:I'm “still afraid to use spaces in file names” years old by marginalia_nu on Thursday November 11, 2021 @01:48PM (#29191499)
Got to tweak HIMEM.SYS before the slumbering one can be awakened.
Re:I'm “still afraid to use spaces in file names” years old by aksss on Thursday November 11, 2021 @07:09PM (#29194879)
PEEK and POKE could break the HIMEM.
Re:I'm “still afraid to use spaces in file names” years old by floatingatoll on Thursday November 11, 2021 @11:21AM (#29189676)
For whatever it’s worth, this is a terrible idea, for so many different reasons:

https://web.archive.org/web/20100107184218/http://blogs.msdn...

And so, yes, I’m certain someone must have done it, because it’s clearly bad idea jeans and so Murphy’s Law says it must exist.

Re:I'm “still afraid to use spaces in file names” years old by benibela on Thursday November 11, 2021 @09:18PM (#29195652)
Can that work for i > 9 ?
Re:I'm “still afraid to use spaces in file names” years old by floatingatoll on Friday November 12, 2021 @04:36AM (#29197648)
If you mkdir PROGRA~10, yes!
Re:I'm “still afraid to use spaces in file names” years old by TowerTall on Saturday November 13, 2021 @11:02PM (#29215275)
And on mine (Windows 11) "PROGRA~3" is "ProgramData"
Re:I'm “still afraid to use spaces in file names” years old by selfhoster11 on Thursday November 11, 2021 @09:47AM (#29188361)
Truly lifesaving for when she'll quoting gets in the way.
Re:I'm “still afraid to use spaces in file names” years old by kijin on Thursday November 11, 2021 @11:32AM (#29189850)
You've got a stray single quote in your shell. :)
Re:I'm “still afraid to use spaces in file names” years old by selfhoster11 on Thursday November 11, 2021 @11:49AM (#29190069)
That was a typo, but it seemed like a perfect illustration of my point, so I left it in.
Re:I'm “still afraid to use spaces in file names” years old by Someone on Thursday November 11, 2021 @12:39PM (#29190691)
Typo? I would guess it’s autocomplete at work. iOS does that all the time for me.
Re:I'm “still afraid to use spaces in file names” years old by lifthrasiir on Thursday November 11, 2021 @09:03AM (#29187913)
And yet they introduced C:\ProgramData in later versions.
Re:I'm “still afraid to use spaces in file names” years old by jjoonathan on Thursday November 11, 2021 @09:10AM (#29187970)
Imagine if they made programmers put 64 bit DLLs in a "System32" directory and 32 bit DLLs in a "SysWoW64" directory. That would really keep 'em on their toes!
Re:I'm “still afraid to use spaces in file names” years old by eyegor on Thursday November 11, 2021 @09:16AM (#29188042)
You should look into the behavior of the /windows/sysnative link. It appears and disappears depending on whether your process is running as 32 bit or 64 bit.
Re:I'm “still afraid to use spaces in file names” years old by Karuma on Thursday November 11, 2021 @10:07AM (#29188603)
Programmers should never put DLLs in those folders... Or even ever touch them.
Re:I'm “still afraid to use spaces in file names” years old by mastax on Thursday November 11, 2021 @10:20AM (#29188758)
Except for \Windows\System32\drivers\etc\hosts, of course.
Re:I'm “still afraid to use spaces in file names” years old by jaywalk on Thursday November 11, 2021 @10:41AM (#29189105)
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 by jve on Thursday November 11, 2021 @05:46PM (#29194241)
Re:I'm “still afraid to use spaces in file names” years old by blincoln on Thursday November 11, 2021 @11:07AM (#29189478)
Maybe it's from back before Windows had a built-in TCP/IP stack? If it were a third-party/optional driver, having files related to it in a path under system32\drivers would make sense.
Re:I'm “still afraid to use spaces in file names” years old by mjevans on Thursday November 11, 2021 @01:17PM (#29191115)
Back around Win 95 when they added networking it was based off of (IIRC) BSD's TCP stack and related tools. They were an optional 'third party' driver of sorts, but shipped by the first party. I'm not positive about WinNT or Win3.11 (for workgroups?)
Re:I'm “still afraid to use spaces in file names” years old by mixmastamyk on Thursday November 11, 2021 @02:33PM (#29192108)
I remember adding "trumpet winsock" to Win 3.x back in the day. Says '94 for that, and summer of '93 for NT 3.1 debut:

https://en.wikipedia.org/wiki/Trumpet_Winsock

https://en.wikipedia.org/wiki/Windows_NT_3.1

Re:I'm “still afraid to use spaces in file names” years old by HideousKojima on Thursday November 11, 2021 @02:26PM (#29192026)
They originally copied BSD's network stack, IIRC
Re:I'm “still afraid to use spaces in file names” years old by kevin_thibedeau on Friday November 12, 2021 @01:58AM (#29196952)
They already hamstrung themselves with LONG because DWORD just wasn't good enough and now long can't be 64-bit either.
Re:I'm “still afraid to use spaces in file names” years old by kitkat_new on Thursday November 11, 2021 @09:10AM (#29187964)
why "yet"?

one occurrence is enough to make devs care about it

Re:I'm “still afraid to use spaces in file names” years old by Matthias247 on Thursday November 11, 2021 @06:13PM (#29194458)
It not only keeps people on their toes due to the whitespace. The folder name is even localized. E.g. with german settings there is C:\Programme and c:\Programme (x86).
Re:I'm “still afraid to use spaces in file names” years old by spacechild1 on Thursday November 11, 2021 @10:55PM (#29196164)
You can still use the English names, though.
Re:I'm “still afraid to use spaces in file names” years old by hetspookjee on Thursday November 11, 2021 @12:29PM (#29190581)
I wonder how much global work could have been saved if Microsoft also provided a covered interface for all paths in the system. Not sure if there is any, but one good implementation might save thousands of poor implementations required to handle it.
Re:I'm “still afraid to use spaces in file names” years old by moontear on Thursday November 11, 2021 @12:36PM (#29190654)
You mean like the Environment.SpecialFolders enum?

https://docs.microsoft.com/en-us/dotnet/api/system.environme...

There are several other classes that take care of getting folders, least of which checking system variables.

Re:I'm “still afraid to use spaces in file names” years old by Too on Saturday November 13, 2021 @02:55AM (#29208224)
You have %Appdata% and friends.
Re:I'm “still afraid to use spaces in file names” years old by dan-robertson on Thursday November 11, 2021 @03:48PM (#29192958)
On the other hand their case sensitivity behaviour means that “cross-platform” Java applications can break if they are run on a non-windows platform where opening files is case sensitive (unlike on windows)
Re:I'm “still afraid to use spaces in file names” years old by 908B64B197 on Thursday November 11, 2021 @06:25PM (#29194573)
It's actually a feature.

Easier to add a flag to ignore case rather than fix bugs where files only differ by case and are therefore overwritten on a case-insensitive filesystem.

Re:I'm “still afraid to use spaces in file names” years old by lamontcg on Thursday November 11, 2021 @02:56PM (#29192379)
Then they made poor APIs so that you have to do this to get it correct:

https://docs.microsoft.com/en-gb/archive/blogs/twistylittlep...

In nix at least you can call execve or other APIs that take a char argv[] and the whole problem is largely solved and you don't need to quote things.

Re:I'm “still afraid to use spaces in file names” years old by anarazel on Thursday November 11, 2021 @08:26PM (#29195360)
I just wish they had a decent way to execute programs with arguments that might include spaces. But no, every program can do argument delineation differently.
Re:I'm “still afraid to use spaces in file names” years old by account42 on Friday November 12, 2021 @06:46AM (#29198331)
And Microsoft even provides three different slightly incompatible ways to parse arguemnts: CommandLineToArgvW, the CRT and cmd.exe.
Re:I'm “still afraid to use spaces in file names” years old by drdeca on Thursday November 11, 2021 @07:44PM (#29195101)
I know that at least like, idk like 3-5 years ago, when I had gotten a new windows laptop (windows 7 or 8 I think), setting the main account to have the name "" (without the quotes), caused some problems with the basic functioning, including, I think, with some pre-installed programs,

So, some things were still being handled not quite right (whether that's because it shouldn't be allowed to be the username, or because programs should handle it being in the path, I'm not sure, but probably one of those.)

Re:I'm “still afraid to use spaces in file names” years old by billti on Thursday November 11, 2021 @04:15PM (#29193275)
And then to really mess you up and ensure you handle parens properly, threw “(x86)” into the mix. (A real pain on some REPLs as well as dealing with environment variables).
Re:I'm “still afraid to use spaces in file names” years old by vesinisa on Thursday November 11, 2021 @05:20PM (#29193988)
Except for programs that were too old / obscure to fix I guess. I think at least the Symbian Development Kit was such that builds would fail with strange errors unless you installed it in any other path than the default immediate subdirectory of C:\, let alone under "Program Files".
Re:I'm “still afraid to use spaces in file names” years old by gattilorenz on Thursday November 11, 2021 @04:57PM (#29193714)
Funny, in the Italian Win9x it is C:\Programmi, which I always thought was more convenient because of the lack of spaces :)
Re:I'm “still afraid to use spaces in file names” years old by cerved on Thursday November 11, 2021 @05:13PM (#29193902)
Sure. Microsoft only ever ships features
Re:I'm “still afraid to use spaces in file names” years old by 8bitsrule on Saturday November 13, 2021 @12:20PM (#29211419)
At one time there was no number 0. Half of binary was missing.
Re:I'm “still afraid to use spaces in file names” years old by antihero on Thursday November 11, 2021 @05:18PM (#29193969)
Shame it wasn't

> C:\P̷̧̽r̸̬͘ŏ̵̮g̷̜͘r̸̦̋a̴͎̒m̶̲̈́ ̷̠̉F̵͇̈ĩ̴̫l̶̨͗ë̵̦s̸͚͆\

Re:I'm “still afraid to use spaces in file names” years old by zaphirplane on Sunday November 14, 2021 @01:16AM (#29215703)
There was a short path name IIRC like prog~1
Re:I'm “still afraid to use spaces in file names” years old by zerr on Friday November 12, 2021 @03:07AM (#29197240)
Could you please link the reference?
Re:I'm “still afraid to use spaces in file names” years old by henrikschroder on Thursday November 11, 2021 @04:11PM (#29193228)
C:\PROGRA~1

Easy fix!

Re:I'm “still afraid to use spaces in file names” years old by Izkata on Thursday November 11, 2021 @09:22AM (#29188095)
> 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.

Re:I'm “still afraid to use spaces in file names” years old by floatingatoll on Thursday November 11, 2021 @09:35AM (#29188223)
I set my nickname to U+FFFD at one point in one work system, resulting in a variety of bug reports and concerned emails. I think I dropped it since it was generating false reports from people who didn't check what character the page contained before reporting it.
Re:I'm “still afraid to use spaces in file names” years old by enragedcacti on Thursday November 11, 2021 @12:59PM (#29190904)
To have such thoughtful coworkers. On an old team I had two coworkers named Chris and once in a blue moon when they reviewed each other code master would start crashing because one of them accidentally left in an absolute path starting with "/home/chris/".
Re:I'm “still afraid to use spaces in file names” years old by ajmurmann on Thursday November 11, 2021 @10:23AM (#29188794)
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.
Re:I'm “still afraid to use spaces in file names” years old by scubbo on Thursday November 11, 2021 @12:35PM (#29190652)
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 by ajmurmann on Friday November 12, 2021 @12:36AM (#29196592)
Maybe an example of the failure this detects helps: when I used to work on Rails apps in the olden days it was easy to call Time.now and get the local time instead of Time.zone.now to get UTC time. This often lead to wrong dates but tests would only fail once it was a new day in UTC land but still the old day in the local time zone. Making the CI machine's system time something Fiji time really helped in getting failures much sooner after changes were pushed.
Re:I'm “still afraid to use spaces in file names” years old by Teknoman117 on Thursday November 11, 2021 @06:04PM (#29194397)
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 by brundolf on Thursday November 11, 2021 @11:50AM (#29190082)
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.
Re:I'm “still afraid to use spaces in file names” years old by cpeterso on Thursday November 11, 2021 @04:16PM (#29193282)
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 by reaperducer on Thursday November 11, 2021 @10:19AM (#29188746)
One of the systems I built is being used by a group of younger people. I included an emoji in the superuser account name, just to make sure it would work. And to remind me to think more broadly about user input.
Re:I'm “still afraid to use spaces in file names” years old by ygra on Saturday November 13, 2021 @02:41AM (#29208158)
I've used to have a space in my user name and even contemplated to add a bit of non-1252 Unicode. You find a lot of issues, but unfortunately often in tools you have little control over and end up not being able to work effectively at times. It ended up being more frustrating than helpful.
Re:I'm “still afraid to use spaces in file names” years old by ridaj on Thursday November 11, 2021 @09:44AM (#29188315)
Áčçëñts hęlp tóø
Re:I'm “still afraid to use spaces in file names” years old by ygra on Saturday November 13, 2021 @02:46AM (#29208182)
For anyone curious, this is called Pseudo-localization (https://en.wikipedia.org/wiki/Pseudolocalization). I first singled across this in Raymond Chen's blog.
Re:I'm “still afraid to use spaces in file names” years old by qwertox on Thursday November 11, 2021 @05:44PM (#29194222)
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 by fernandotakai on Thursday November 11, 2021 @02:40PM (#29192182)
my test accounts always have emojis + accents + other weird characters.

it keeps everybody on their toes lol.

Re:I'm “still afraid to use spaces in file names” years old by curuinor on Thursday November 11, 2021 @01:50PM (#29191519)
the proper name of the glorious sultan of slack, j. r. "bob" dobbs, has the quotation marks and therefore is a great subject for this
Re:I'm “still afraid to use spaces in file names” years old by geoduck14 on Thursday November 11, 2021 @09:30AM (#29188160)
Oh, I like this!
Re:I'm “still afraid to use spaces in file names” years old by soheil on Thursday November 11, 2021 @06:30PM (#29194613)
Obligatory xkcd https://xkcd.com/327/
Re:I'm “still afraid to use spaces in file names” years old by josteink on Thursday November 11, 2021 @10:09AM (#29188623)
> 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 consider spaces “unusual” I would say you haven’t encountered a single average user in your lifetime. Spaces in file-names is the single most common thing people have, outside programming environments.

As a x-plat developer, the only platform where I (still) regularly encounter these kind of bugs are platforms where solving problems through scripting is common, like Linux, where the primary means of operation is through stringly-typed statements getting parsed and processed in a untyped-fashion. It's not very reliable.

On Windows people more often use “real APIs” (because scripting doesn't really work as well), but then these problems just goes away.

Pros and cons, I guess.

Re:I'm “still afraid to use spaces in file names” years old by SAI_Peregrinus on Thursday November 11, 2021 @02:40PM (#29192184)
It's especially funny that it affects Linux so much. Most file systems allow everything except `/` and NULL in file names. Early AT&T UNIX even allowed NULLs! POSIX shells use the IFS variable to perform field splitting, and it defaults to <space>, <tab>, and <newline>. The choice to perform field splitting by default (particularly with spaces in the default IFS set) has caused no end of headaches for developers and users.
Re:I'm “still afraid to use spaces in file names” years old by jeffwask on Thursday November 11, 2021 @09:09AM (#29187962)
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 constructs that provide minimal value for the extra complexity.

Re:I'm “still afraid to use spaces in file names” years old by long_time_gone on Thursday November 11, 2021 @10:10AM (#29188637)
> 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?

Re:I'm “still afraid to use spaces in file names” years old by JCharante on Thursday November 11, 2021 @02:54PM (#29192349)
I'm not sure, but my gut instinct is that it wouldn't help. Dyslexia rates are much lower in China, so if I suppose we could start naming files with Chinese characters (on systems that support Unicode). It would take a bit to get used to, but eventually we'd develop a pidgin language for when we talk about software, much like how if you overhear Chinese or Vietnamese developers they will mix in English words like "linked list" into their sentences, because there's not a more natural sounding alternative.

Switching to Chinese would also help eliminate the spaces issue.

Re:I'm “still afraid to use spaces in file names” years old by teorema on Thursday November 11, 2021 @03:46PM (#29192933)
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.

Re:I'm “still afraid to use spaces in file names” years old by vertere on Thursday November 11, 2021 @05:52PM (#29194291)
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 by reaperducer on Thursday November 11, 2021 @10:22AM (#29188783)
Or in my case, people for whom English is a second language, or have low education levels.

Saying, "who can't understand..." is arrogant, selfish, and an example of why normal people hate people in the SV echo chamber.

Re:I'm “still afraid to use spaces in file names” years old by jeffwask on Thursday November 11, 2021 @02:27PM (#29192034)
cestmaconfig.txt vs cest ma config.txt vs cest_ma_config.txt

It's the same in any language.

Hugs who hurt you.

I'm also pretty sure most of us in any language use Slack, SMS or other forms of communication where text isn't necessarily presented in a grammatical correct manner and we all figure out what the person is saying.

Re:I'm “still afraid to use spaces in file names” years old by long_time_gone on Thursday November 11, 2021 @10:37AM (#29189041)
> Saying, "who can't understand..." is arrogant, selfish, and an example of why normal people hate people in the SV echo chamber

Exactly how I feel every time Economics is brought up on HN.

Re:I'm “still afraid to use spaces in file names” years old by throwaway2077 on Thursday November 11, 2021 @10:50AM (#29189234)
SV echo chamber is on your side here - it is very in vogue to denounce anglocentrism. they were defending hieroglyphs and emoji in variable names in that thread about invisible javascript backdoor a day or two ago if you'd like a recent example
Re:I'm “still afraid to use spaces in file names” years old by dang on Thursday November 11, 2021 @11:33AM (#29189874)
Could you please stop posting ideological battle comments to HN? We ban accounts that do that, regardless of their ideology, because it's (a) not what this site is for, and (b) destroys what it is for.

If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.

Re:I'm “still afraid to use spaces in file names” years old by danlugo92 on Thursday November 11, 2021 @12:10PM (#29190336)
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.

Re:I'm “still afraid to use spaces in file names” years old by beambot on Thursday November 11, 2021 @12:28PM (#29190573)
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.
Re:I'm “still afraid to use spaces in file names” years old by danlugo92 on Thursday November 11, 2021 @04:27PM (#29193415)
> 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 by Hallucinaut on Friday November 12, 2021 @07:54AM (#29198820)
What does "fair" mean in this usage? If it means one position attracts a lopsided balance of comments either for or against then surely that's always going to be the case?

Otherwise what is your proposition, don't state any opinion unless you find a counter opinion commenter to match with?

Lots of folk here are pro-privacy and lots of folk are anti-bitcoin (and some of them will be the latter because they're the former) so I don't understand how you'd extended your position in a way that leaves HN with any value.

Re:I'm “still afraid to use spaces in file names” years old by rch on Thursday November 11, 2021 @01:24PM (#29191196)
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.
Re:I'm “still afraid to use spaces in file names” years old by fouric on Thursday November 11, 2021 @04:34PM (#29193488)
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 by Too on Saturday November 13, 2021 @03:09AM (#29208261)
Why stop there. A computer works more efficiently with numbers rather than strings, so let’s just give each file a number instead of a string. Besides, at this point with how digital we have all become who can’t understand… But wait, that already exists and is called an inode.

A file system has a human interface and a computer interface. Don’t mix them. Let users give file names in whichever way they please.

Re:I'm “still afraid to use spaces in file names” years old by 400thecat on Thursday November 11, 2021 @12:44PM (#29190753)
> 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 by mwcampbell on Thursday November 11, 2021 @10:49AM (#29189218)
My favorite filename special character bug was when I implemented CD ripping in 2005, and one of our beta testers ripped a CD with a song called "Have You Ever?". My code wasn't prepared to filter out the question mark on Windows.
Re:I'm “still afraid to use spaces in file names” years old by mixmastamyk on Thursday November 11, 2021 @02:36PM (#29192138)
I just hit the one where an album folder ends in a period. Rsync copies every time because the period is dropped by the filesystem silently. :-/
Re:I'm “still afraid to use spaces in file names” years old by wongarsu on Thursday November 11, 2021 @11:15AM (#29189583)
> Pro tip: rename your development directory

I changed my username to not contain a space because it was too annoying to deal with all the random dev tools breaking. The worst offender was probably npx on Windows [1] (resolved after four years by deprecating npx), but it was far from the only one (though the JS ecosystem was somehow the worst in this regard of all languages I worked with).

1: https://github.com/zkat/npx/issues/100

Re:I'm “still afraid to use spaces in file names” years old by kermire on Friday November 12, 2021 @12:34AM (#29196582)
Same, even I had to rename my user folder to not have a space because so many tools were breaking.
Re:I'm “still afraid to use spaces in file names” years old by sysadm1n on Thursday November 11, 2021 @10:47AM (#29189184)
> other unusual characters in file names

Saw a few hacks where malware authors used the RTL feature (which is baked into Windows) to obfuscate file extensions. It looked like .exe.innocuous-document.docx, but was actually .docx.innocuous-document.exe

Re:I'm “still afraid to use spaces in file names” years old by masklinn on Friday November 12, 2021 @04:33AM (#29197631)
This exact vulnerability in most modern code editors just made the rounds, allowing smuggling malicious code right through review.
Re:I'm “still afraid to use spaces in file names” years old by shane_b on Thursday November 11, 2021 @09:57AM (#29188465)
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.

Re:I'm “still afraid to use spaces in file names” years old by memsom on Thursday November 11, 2021 @10:05AM (#29188580)
I once returned a printer because the Mac driver and support software expected and enforced case insensitive access and basically couldn't install properly on my case-sensitive HFS+ volume. It half installed and blatantly just didn't work in any way when installed.
Re:I'm “still afraid to use spaces in file names” years old by NegativeLatency on Thursday November 11, 2021 @11:37AM (#29189916)
Adobe software used to refuse to install on case sensitive file systems back in the not too distant past.
Re:I'm “still afraid to use spaces in file names” years old by deckard1 on Thursday November 11, 2021 @02:41PM (#29192198)
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 2000s. It was solved. It was done. Then devs became enamored with running everything locally. Even dozens of microservices or databases. Even though JS is fairly isolated, you still have NPM packages that need built against the local OS and C/C++ library and compilers, etc. Which also has caused issues in the past.

Re:I'm “still afraid to use spaces in file names” years old by speedgoose on Thursday November 11, 2021 @03:39PM (#29192866)
Good news, we have solutions. You could use continuous integration and software containers like Docker.
Re:I'm “still afraid to use spaces in file names” years old by fouric on Thursday November 11, 2021 @04:39PM (#29193527)
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).
Re:I'm “still afraid to use spaces in file names” years old by handrous on Thursday November 11, 2021 @05:09PM (#29193851)
Docker relies on LXC, so it's Linux-only. On other platforms it runs in a Linux VM. The host for Docker, then, is Linux no matter where you are.
Re:I'm “still afraid to use spaces in file names” years old by zokier on Thursday November 11, 2021 @07:14PM (#29194907)
> Docker relies on LXC, so it's Linux-only.

Docker hasn't supported LXC since 2016, and stopped relying on it in 2014

https://www.docker.com/blog/docker-0-9-introducing-execution...

Re:I'm “still afraid to use spaces in file names” years old by handrous on Friday November 12, 2021 @11:38AM (#29201210)
I thought the name for the collection of kernel features was LXC, I didn't realize (until just now) that was the name only for the also-kernel-level wrapper for those features, which name does not cover the features themselves. That is, I didn't realize that LXC is to Cgroups+Namespaces as Libvirt is to KVM—I thought LXC, as a label, covered the whole feature-set—but regardless, it's still married to Linux kernel features and runs on other platforms under virtualization, no?
Re:I'm “still afraid to use spaces in file names” years old by zokier on Friday November 12, 2021 @08:42PM (#29206548)
> it's still married to Linux kernel features and runs on other platforms under virtualization, no?

Actually no. At least on Windows Docker can do native Windows containers too

https://poweruser.blog/lightweight-windows-containers-using-...

Re:I'm “still afraid to use spaces in file names” years old by jatone on Thursday November 11, 2021 @07:12PM (#29194897)
my favorite is often being the only developer on linux and giving two files with different casing and watching their systems crash and burn.
Re:I'm “still afraid to use spaces in file names” years old by mdaniel on Thursday November 11, 2021 @01:08PM (#29191002)
I also enjoyed doing that, but had to make a DMG just for Steam because it straight-up refuses to run on a case sensitive FS (that's true on Windows, also, which I suspect is how we all got here). I think the most recent Steam versions either caught wind of my trickery or -- more likely -- run something from $HOME/Library/SomethingOrOther and thus the work-around it no longer works

When I got a new Mac, I just gave up and acquiesced to the case-retentive world :-(

Re:I'm “still afraid to use spaces in file names” years old by dunham on Thursday November 11, 2021 @11:20AM (#29189658)
Circa Y2k, I learned that the OSX Palm Pilot software didn't work with case sensitive. I've since given up and stuck with the default. (I'm anti-case folding in general, because of the ambiguity.)
Re:I'm “still afraid to use spaces in file names” years old by achn on Thursday November 11, 2021 @10:06AM (#29188591)
I maintain a similar system, where a variety of companies submit files that get processed through multiple services - it is astounding how ridiculous people’s naming of files can be; spaces are the least concerning!
Re:I'm “still afraid to use spaces in file names” years old by rossy on Thursday November 11, 2021 @06:25PM (#29194564)
> anything with subprocesses

I'm begging software developers to stop using subprocess APIs that take a string argument (system(), child_process.exec(), Process.Start(string)) and start using subprocess APIs that take an array of arguments (execvp(), child_process.execFile(), Process.Start(string, IEnumerable<string>).)

Re:I'm “still afraid to use spaces in file names” years old by lifthrasiir on Thursday November 11, 2021 @09:01AM (#29187889)
While I agree that we should do this in the ideal world, doing so will inevitably break other necessary tools so it is unworkable for me :(
Re:I'm “still afraid to use spaces in file names” years old by cduzz on Thursday November 11, 2021 @01:18PM (#29191128)
And add a emoji, a character in a right to left language ( א) and perhaps 太. Maybe italicize one of those too...
Re:I'm “still afraid to use spaces in file names” years old by cerved on Thursday November 11, 2021 @05:20PM (#29193983)
Spaces are a pain in the ass when you're using CLI so I'd rather enforce a no space policy
Re:I'm “still afraid to use spaces in file names” years old by reayn on Thursday November 11, 2021 @05:29PM (#29194099)
Most shells will behave just fine if you put a quote (single or double) before anything that has a space.

A small extra step but something you get used to if you spend a lot of time in the cli.

Re:I'm “still afraid to use spaces in file names” years old by cerved on Friday November 12, 2021 @01:50AM (#29196914)
Escaping spaces is a pain. I have to do it every day.

I set up symlinks which help navigating around but then the relative paths are wrong for git.

No thanks.

Friends don't let friends put spaces in paths

Re:I'm “still afraid to use spaces in file names” years old by redwall_hp on Thursday November 11, 2021 @01:27PM (#29191232)
I don't know if it's still a problem, but it used to break Python virtualenv badly. If your working directory had a space anywhere in the path, it would throw a huge fit and not work. Which is problematic when the expected name for a Mac's boot drive is "Macintosh HD" (if you ever had a reason to run a virtualenv outside of your home directory).
Re:I'm “still afraid to use spaces in file names” years old by kitkat_new on Thursday November 11, 2021 @09:09AM (#29187955)
Pro tip2: Use std lib path processing utilities
Re:I'm “still afraid to use spaces in file names” years old by WalterBright on Thursday November 11, 2021 @08:11PM (#29195262)
Sometimes / works as a path separator in Windows, sometimes it doesn't. It's not predictable.

I never use / on Windows as a result.

Re:I'm “still afraid to use spaces in file names” years old by ygra on Saturday November 13, 2021 @03:07AM (#29208256)
The only common place where it doesn't work is in CMD for executing programs and as arguments for built-in commands. Everything else goes directly to the relevant APIs which don't care about / or \.

These days using CMD instead of PowerShell should be rare enough and PowerShell certainly doesn't mind the slashes.

Re:I'm “still afraid to use spaces in file names” years old by InfiniteRand on Thursday November 11, 2021 @04:13PM (#29193245)
It's easy to tell users to make a folder with no spaces if you're setting up a global path, however if you have an application that runs in user directories things can become painful fast. Changing your user name is a pain and can leave things inconsistent, but having to handle all the variations in people's names with spaces, punctuation, international characters, can just be mind boggling.
Re:I'm “still afraid to use spaces in file names” years old by uberswe on Friday November 12, 2021 @05:01AM (#29197790)
I did something similar on accident. I used to keep all my development work synced with Dropbox and I had a work and a personal account. So any of my own projects would have /Dropbox (Personal)/ in the path which did catch some bugs. Dropbox renamed my folder to "Dropbox (Personal)" automatically when connecting a work account.
Re:I'm “still afraid to use spaces in file names” years old by franga2000 on Friday November 12, 2021 @04:24AM (#29197570)
More importantly than your source files, put your testing data on such a path as well. Nobody uses absolute paths in testing so it doesn't matter how many spaces your absolute path has if your input is "./tests/file1". Put those files in a folder with spaces too and throw in a unicode character for good measure.
Re:I'm “still afraid to use spaces in file names” years old by BiteCode_dev on Thursday November 11, 2021 @03:41PM (#29192888)
> Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space and/or special characters in it.

The problem with that is that YOUR code may handle it, but your tooling may not. If my code formatter break on spaces, I'm not going to change the formatter.

Re:I'm “still afraid to use spaces in file names” years old by ChrisSD on Thursday November 11, 2021 @03:55PM (#29193043)
You could submit a PR to their repo.
Re:I'm “still afraid to use spaces in file names” years old by BiteCode_dev on Thursday November 11, 2021 @06:17PM (#29194492)
I could submit a PR to 5 tools a week on average. I actually have the time and resources to do it once a year.

Last week I opened a ticket for a Firefox bug. Following up on the bug took me 2 hours in total.

FOSS is not free, you pay it with your time. And as with everything you pay for, we all have a budget.

Re:I'm “still afraid to use spaces in file names” years old by idatum on Thursday November 11, 2021 @02:51PM (#29192312)
Somewhat related to injecting unusual characters, in my experience in localization efforts:

Inject a Turkish 'I'. I don't know how to type or paste it here, but picture an English lower case 'i' that is upper case. It is a splendid way among many to shake out some loc bugs.

Re:I'm “still afraid to use spaces in file names” years old by gus_massa on Thursday November 11, 2021 @05:14PM (#29193924)
Re:I'm “still afraid to use spaces in file names” years old by ygra on Saturday November 13, 2021 @03:10AM (#29208265)
That would only shake out anything if you'd also test in a Turkish locale, wouldn't it? Since Unicode casing rules are locale-dependent and en-US doesn't care much about dotless i or dotted i.
Re:I'm “still afraid to use spaces in file names” years old by ralphc on Thursday November 11, 2021 @03:05PM (#29192487)
Late '90s I worked on Java software that got installed on several Unix platforms, including Linux for IBM mainframes. When you deal with the default en/de-coding of Unicode to EBCDIC you never have trouble with Java byte encodings ever again.
Re:I'm “still afraid to use spaces in file names” years old by Spooky23 on Thursday November 11, 2021 @02:46PM (#29192243)
Someone should provide the OneDrive/SharePoint people some of this religion.

Mysterious character requirements that do not conform with Microsoft’s OS limits, limits on tbe fully qualified pathname length, etc.

Re:I'm “still afraid to use spaces in file names” years old by Foobar8568 on Thursday November 11, 2021 @11:08AM (#29189484)
Let's not forget return carriages in filenames within apps...
Re:I'm “still afraid to use spaces in file names” years old by wldcordeiro on Thursday November 11, 2021 @01:54PM (#29191581)
Even capitalization is a pain in the ass thanks to how OSes treat file names. I pretty much stick with either `file-name.ext` or `file_name.ext` exclusively now.
Re:I'm “still afraid to use spaces in file names” years old by AlfeG on Friday November 12, 2021 @01:41AM (#29196871)
Today I learned that You cannot install Tailscale on windows if installer is inside path with non-latin chars.
Re:I'm “still afraid to use spaces in file names” years old by qwertox on Thursday November 11, 2021 @05:41PM (#29194194)
In that case, be thorough and insert a Chinese and an Arabic character to enforce a Unicode check.
Re:I'm “still afraid to use spaces in file names” years old by agumonkey on Thursday November 11, 2021 @05:29PM (#29194098)
See the recent article about unicode invisible glyphs in JavaScript or bash.

Naming freedom needs a stdlib module

Re:I'm “still afraid to use spaces in file names” years old by 5faulker on Thursday November 11, 2021 @01:22PM (#29191163)
For those purposes I've found hyphen to be a nice substitute.
Re:I'm “still afraid to use spaces in file names” years old by echelon on Thursday November 11, 2021 @10:02AM (#29188539)
Better solution: only allow ASCII, maybe dashes, and up to twelve characters. Problem solved.

Enforce this in LDAP.

Strict convention is better than flexibility and predicting obscure edge cases that can fail.

Re:I'm “still afraid to use spaces in file names” years old by pimterry on Thursday November 11, 2021 @10:11AM (#29188653)
In my case, and for many people writing desktop software, and for absolutely everybody writing open-source tools or libraries, unfortunately you can't control the environment.

Non-ASCII paths are extremely common (e.g. the user's home directory on Windows, for the large majority of users outside the English-speaking world) and spaces, punctuation and weirder characters will definitely happen when you least expect it.

Yes if you can avoid it then absolutely that's great, but I don't think most people can.

It's also not usually very difficult to deal with, as long as you actually spot the issue in the first place.

Re:I'm “still afraid to use spaces in file names” years old by reaperducer on Thursday November 11, 2021 @10:25AM (#29188830)
only allow ASCII, maybe dashes, and up to twelve characters. Problem solved

...and only hire people from the exact same background as you, who will never have unusual characters or accents in their name. And also make sure not to have any users who aren't exactly like you, and conform to this very narrow requirement. Surely, excluding 90% of the world won't hurt revenue in any way.

Re:I'm “still afraid to use spaces in file names” years old by echelon on Thursday November 11, 2021 @10:52AM (#29189276)
Snarky, but I'll take it.

Use strict schema for the hardware interface, networking, physical stuff the user never sees. Microservice names don't need to be non-Latin. Database replicas, infrastructures, etc. And you're not going to piss off employees by giving them ASCII ldap/email addresses.

Use utf8mb4 or similar for storing names. Don't state "first" or "last". I've been through this rodeo too many times. You're not surprising anyone.

Re:I'm “still afraid to use spaces in file names” years old by stopagephobia on Thursday November 11, 2021 @02:24PM (#29191999)
This is not excluding? I just use an ascii canonicalized version of my name and works fine.
Re:I'm “still afraid to use spaces in file names” years old by numpad0 on Thursday November 11, 2021 @11:33AM (#29189864)
UTF-8 strings aren’t reproducible anyways. User ID should be strictly for identification, be alphanumeric random string if necessary.
Re:I'm “still afraid to use spaces in file names” years old by badsectoracula on Thursday November 11, 2021 @06:26PM (#29194575)
You can use an "ASCII-fied" version of the name, only ~27% of mine can be typed in ASCII letters that look similar but the rest is just phonetically or visually close-enough letters. This is something people did for decades and nowadays even government IDs have an ASCII-fied (well, Latin-fied) version of the name.
Re:I'm “still afraid to use spaces in file names” years old by mikepurvis on Thursday November 11, 2021 @10:19AM (#29188739)
Ugh, we have the 15 character Active Directory limit now with hostnames, and a previous IT administration has imposed a convention that every name had to follow [prod|dev]-[ph|vm]-[service]-[nn]. So basically every production service is prod-vm-owtf-01— you get exactly four characters to actually describe what the machine does. Works great when the service is "jira" or "wiki", but there are a lot that are pretty mystical-sounding, like jkns, jwrk, cntr, hrbr, etc, where you kind of just have to know.
Re:I'm “still afraid to use spaces in file names” years old by icedchai on Thursday November 11, 2021 @11:29AM (#29189815)
Do they at least allow you to set up CNAMEs?
Re:I'm “still afraid to use spaces in file names” years old by mikepurvis on Thursday November 11, 2021 @02:27PM (#29192036)
Yes, and for many of the web-serving machines, that's what happens, they're jenkins.example.com or containers.example.com or similar. But often a singular service is backed by hidden worker nodes, databases, whatever else, and it seems silly to give those machines that level of indirection vs just using the hostname as their sole identifier.
Re:I'm “still afraid to use spaces in file names” years old by HNo on Thursday November 11, 2021 @10:39AM (#29189065)
I kind of like that honestly. No doubt you need some documentation so everyone knows what the service abbreviations are, but after you've been working there for a month you get it. Makes everything clean, consistent, and informational. You can quickly ascertain what a specific host is doing just from the name.
Re:I'm “still afraid to use spaces in file names” years old by mikepurvis on Thursday November 11, 2021 @02:24PM (#29192000)
Oh absolutely it makes sense to have a standard, and being able to tell at a glance if something is a VM or physical machine is of value also. But dedicating 2/3s of the character budget to such a scheme is madness. If the prod-vm- prefix simply become pv-, then you'd at least be able to do pv-jenkins-01 again.

Anyway, all this was fine when we were on LDAP rather than Active Directory. So basically it's all Windows' fault.

Re:I'm “still afraid to use spaces in file names” years old by MayeulC on Thursday November 11, 2021 @10:18AM (#29188735)
Ah, that's the he enterprise edition.

But then your program will crash hard and unexpectedly when a user decides to save under "~/house plans" or ~/Téléchargements.

I think it's better to exercise this in CI, that's what CI is for.

Re:I'm “still afraid to use spaces in file names” years old by chris_wot on Thursday November 11, 2021 @10:38AM (#29189054)
And yet OneDrive WP t allow fir spaces before or after a file name.
Re:I'm “still afraid to use spaces in file names” years old by alx__ on Friday November 12, 2021 @02:03AM (#29196976)
I spent hours trying to figure out why an entire folder suddenly stopped syncing. Turns out I accidentally added a hidden space to the end of a folder name.
Re:I'm “still afraid to use spaces in file names” years old by chris_wot on Sunday November 14, 2021 @11:36AM (#29218243)
Yup, their UI sucks when it comes to sync errors.
Re:I'm “still afraid to use spaces in file names” years old by dheera on Thursday November 11, 2021 @12:40PM (#29190700)
Or not, which when bugs crop up will teach the businessy types to stop putting spaces in their filenames.
Re:I'm “still afraid to use spaces in file names” years old by macintux on Thursday November 11, 2021 @12:50PM (#29190807)
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 by cerved on Thursday November 11, 2021 @05:17PM (#29193953)
depends entirely what you're using to browse files
Re:I'm “still afraid to use spaces in file names” years old by KronisLV on Thursday November 11, 2021 @10:19AM (#29188748)
> Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space and/or special characters in it.

This will also break any code in external tools that are called during the builds of your application and do not handle spaces correctly for whatever reason, thus making it so that you won't be able to successfully finish the build.

Then again, you probably shouldn't be relying on technologies like that, but when you're struggling to keep an old enterprise system alive, causing yourself more problems is not necessarily what you should do.

Still a good idea in most cases, though.