Live data from Hacker News

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

twitter.com

681–690 of 817 posts

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

#681

Earlier quoted context omitted.

This goes for most instances of user input. Timestamps is the other common one people get wrong. I've even seen programs that pass around timestamps as strings in multiple formats and as integers (Unix time).

As a programming noob, I'm wondering what would be the better way to pass or return a unix time value as opposed to an integer?

If you need to keep the timezone with it, then use an ISO8601 [0] string: "2021-11-11T15:32:35-07:00".

Otherwise, use an integer unix timestamp, the number of seconds since 1970-01-01T00:00:00Z: 1636673555. Use an unsigned 32-bit integer or a 64-bit integer to avoid the 2038 problem [1]. JSON's maximum safe integer value is a signed 53-bit integer, so if you're using HTTP JSON RPC, you'll have to check for overflow.

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

[1] https://en.wikipedia.org/wiki/Year_2038_problem

[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

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

#682
It's not a matter of being afraid, spaces in filenames are annoying.

I mostly use the shell and navigating in directories with spaces is annoying, you have either to quote it or put a \ before each space. You also have to remember to quote everything, and in bash that can become complex, you start adding quotes everywhere to solve problems caused by spaces (or other special characters like *) in filenames.

So I prefer to not use them, a simple _ is as readable as a space. Only thing is that spaces gets rendered better on graphical file managers, but... that could have been solved (and can still be solved) by simply adding an option to render a _ as a space graphically if there is no ambiguity. I don't care that much since I don't use graphical file managers that much.

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

#683

One of the main reasons why Windows used "Program Files" and "Documents and Settings" was to force the programs (and programmers) to deal with paths with spaces. And you know, for the most part it kinda, more or less worked out although of course even today you will find programs that ask you to install them in a folder without spaces in the path.

That annoys me every time I use a Windows system. It was a terrible decision, especially since both the command prompt and the new powershell doesn't accept like bash a backspace before a space, you have to quote the whole path! I get that most users on Windows don't use the shell, but as a developer I do a lot, and every time it's a pain (no wonder they added the WSL in Windows after the failure of Powershell...)

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

#684

Earlier quoted context omitted.

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.

Got to tweak HIMEM.SYS before the slumbering one can be awakened.

PEEK and POKE could break the HIMEM.

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

#685

Earlier quoted context omitted.

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.

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…

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

#686
post #610

Earlier quoted context omitted.

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).

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.

> 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

#687
post #543
post #507

Earlier quoted context omitted.

One char away also physically on the keyboard (maybe that's what you meant?).

Yeah, the physical layout is the primary concern. I should have noted that since there is ambiguity because n and m also happen to be next to each other in the alphabet.

laughs in dvorak

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

#689

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…

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.

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

#690

Earlier quoted context omitted.

Cue nmcli (CLI for Gnome's NetworkManager) which uses UUIDs for everything and (at least a while ago) did not accept partial-but-unique UUIDs. Basically goes "nmcli connection up 5095665a-d82c-4ae6-8964-283623387941".

apt-get install nmtui # it's better

nmtui is a life saver tbh
Post reply on HN