You can actually use / as a path separator on Windows in functions like fopen(), because it supports some ancient version of POSIX standard.
Programmer Humor
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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
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
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.
The number of times I had to ask "how can I tell where the file 'physically'" (I know) "lives" on the network when I took up work at a Windows shop, it was just baffling. And Win people couldn't understand what I was asking.
There's a location for this effing thing. I want to know where it is, really! How do I get that info?!
Also the internet belongs on the left.
And really, Linux/macos could be reduced to "Unix" https://upload.wikimedia.org/wikipedia/commons/7/77/Unix_history-simple.svg
And BSD. It's really just Windows vs. literally everything. Or is there anything else that uses backslashes?
CP/M
Which in this context is named hilariously.
Typical windows behavior
Only Mac OS 10 and later, based on BSD, uses ‘/‘. (And, I guess, A/UX.) Classic MacOS used a ‘:’, but it wasn’t regularly exposed in the UI. The only way most users would know is that the colon couldn’t be used in a file name.
I don't really watch Star Wars. I'm a more of a Trekkie gal.
🖖
See, you can separate files both ways as long as it's logical
Shouldn’t the blade be green? I thought Luke wore all black in ROTJ when he got hos green lightsaber.
Both works fine in Windows tho?
Used to not
Actually, from what I can tell in my brief 15-minute internet search, every version of Windows since NT has accepted both because DOS 2.0 supported both. The exception to this was Command Prompt. But, these days, it supports both. Not sure when they made that change in Command Prompt, but I think it's been that way since at least Windows 7.
Sadly, I had the great displeasure of writing code for Windows (and DOS) well before then.
Times change. You used to not be able to run Linux in Windows, but you can do that too.
Yeah, and I've tried that. It turns out it works even better if you throw away the Windows part.