this post was submitted on 01 Feb 2025
1066 points (99.4% liked)

Programmer Humor

20251 readers
1487 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 53 points 16 hours ago (2 children)

You can actually use / as a path separator on Windows in functions like fopen(), because it supports some ancient version of POSIX standard.

[–] [email protected] 29 points 16 hours ago

There used to be an undocumented setting in early versions of MS-DOS that would allow the setting of the command option character to something other than the slash, and if you did that, the slash automatically became the path separator. All you needed was SWITCHAR=- in your CONFIG.SYS and DOS was suddenly very Unix-y.

It was taken out after a while because, with the feature being undocumented, too many people didn't know about it and bits of software - especially batch files, would have been reliant on things being "wrong". The modern support for regular slash in API calls probably doesn't use any of the old SWITCHAR code, but it is, in some way, the spiritual descendant of that secret feature.

Here's an old blog that talks about it: https://learn.microsoft.com/en-gb/archive/blogs/larryosterman/why-is-the-dos-path-character

[–] [email protected] 12 points 15 hours ago

The one thing about NT was that it didn't have it's own semantics, but it could emulate any system you wanted. It's the unofficial successor of an OS that was based on creating VMs where you could run any other OS you want.

Then Microsoft decided to create their own system in it, and only really finished writing that one.