Live data from Hacker News

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

twitter.com

491–500 of 817 posts

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

#491
post #307

Earlier quoted context omitted.

I mean we're heading there with /usr being your /System. Redhat/Pottering are doing heroic work in this space. /Users -> /home /System -> /usr /Data -> /var /Config -> /etc /Boot -> /boot /Ephemeral Temp -> /run /Persistent Temp -> /tmp The only real holdouts are proc/sys/dev which are the kernel and mnt/media/opt/srv which are really for the user/sysadmin and aren't really used by the OS anymore.

Genuine question: on what systems is `/tmp` persistent? Both macOS and Ubuntu 20.04 clear `/tmp` on every reboot for me, and I haven't changed the defaults at all.

"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

#492
post #307

Earlier quoted context omitted.

I mean we're heading there with /usr being your /System. Redhat/Pottering are doing heroic work in this space. /Users -> /home /System -> /usr /Data -> /var /Config -> /etc /Boot -> /boot /Ephemeral Temp -> /run /Persistent Temp -> /tmp The only real holdouts are proc/sys/dev which are the kernel and mnt/media/opt/srv which are really for the user/sysadmin and aren't really used by the OS anymore.

Genuine question: on what systems is `/tmp` persistent? Both macOS and Ubuntu 20.04 clear `/tmp` on every reboot for me, and I haven't changed the defaults at all.

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

#494

I had a guy in my team use forward slashes in filenames. Terrible idea, caused all sorts of weird issues.

How was this possible? None of the mainstream operating systems allow this.

via GUI in OS X.

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

#495
post #408

Earlier quoted context omitted.

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.

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 si…

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

#496

Still way too many libraries and programs can't handle spaces in filenames. And shells and other programs still have problems with perfectly legal characters in filenames too, like '!' or ':'.

Is "!" legal in Windows? I'm pretty sure it is not, but I'm not on a Windows machine to test.

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

#498

Earlier quoted context omitted.

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.

"Persistent Temp" should be /var/tmp. "Persistent Temp" is also an oxymoron.

> "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

#499

Earlier quoted context omitted.

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

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.

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

#500

I work on a complex desktop application, and it's been astounding the number of bugs that have appeared over the years triggered by spaces and other unusual characters in file names. If you do anything with subprocesses or path processing, it's absurdly easy to hit in a thousand different ways, over and over again. Pro tip: rename your development directory (or even better: the workspace path in CI) to put a space an…

And add a emoji, a character in a right to left language ( א) and perhaps 太. Maybe italicize one of those too...
Post reply on HN