Conversation

dos/windows batch files are so much fun.

what does this output?
SET FOO = BAR
ECHO %FOO%

1
1
0
answer
Show content

it prints:

%FOO%

1
0
0
re: answer
Show content

The reason? The space before the equals.

SET FOO = BAR actually sets the environment variable "FOO " to " BAR"

4
0
0
re: answer
Show content

yeah sure environment variables can have spaces in them, that's not a mistake that is just going to cause problems

2
0
0
re: answer
Show content

@foone oh my god so many things make sense now and I hate it so much

0
0
0
re: answer
Show content

@foone oh i hate that aspect so much, it's caused me so much bad blood

0
0
0
re: answer
Show content

@foone oh I hate this

0
0
0
re: answer
Show content

@foone cursed fact: there is exactly one character forbidden in macOS file names and its the forward slash. Everything else is allowed. Yes that includes \0

2
0
0
re: answer
Show content

@cinebox @foone macOS straight up uses \r in filenames for purposes too. Might be pre-OS X legacy or something, but it's still there last I checked.

0
0
0
re: answer
Show content

@cinebox @foone how would you even open files with \0 in the name, does objc not use c-style strings?

1
0
0

Hoshino Lina (星乃リナ) 🩵 3D Yuri Wedding 2026!!!

Edited 3 days ago
re: answer
Show content

@foone @cinebox @charlotte Okay so I looked this insanity up and apparently Linux maps ␀ (that's U+2400), UTF-8 encoded in the POSIX APIs of course, to a literal U+0000 in the (UTF-16) HFS+ directory and vice versa (this, of course, means you conversely can't create a filename with an actual U+2400 from Linux). I dont know what macOS does.

Also HFS+ forbids :, not /. However, the POSIX layer swaps those two characters in macOS and Linux does the same.

Whatever is going on with the HFS+ insanity, I'm pretty sure APFS won't allow NUL.

1
0
0
re: answer
Show content

@lina @foone @cinebox this is somehow even more raccursed than i expected

i was thinking “you could have a NUL in the file name if it was an overlong NUL UTF-8 enraccoding”

1
0
0

Hoshino Lina (星乃リナ) 🩵 3D Yuri Wedding 2026!!!

re: answer
Show content

@foone @cinebox @charlotte I actually thought it might be that too, and for all I know that might be what macos does or did at some point? No idea tbh.

0
0
0