• pelya@lemmy.world
    link
    fedilink
    arrow-up
    56
    ·
    23 hours ago

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

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      31
      ·
      23 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

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      22 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.