Announcement

Collapse
No announcement yet.

SDL Storage API Merged For SDL 3.0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SDL Storage API Merged For SDL 3.0

    Phoronix: SDL Storage API Merged For SDL 3.0

    Going back years but documented in 2022 has been a desire for the SDL hardware/software abstraction layer popular with cross-platform games to offer an abstracted file-system API. That's finally come to reality with the new SDL_Storage interface added for SDL 3.0...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    That's why I don't even try to make my (little) programs and scripts compatible with Windows. Especially when it comes to filesystem. Thank god I am not getting paid for doing this and don't try to sell anything.

    Comment


    • #3
      Originally posted by byteabit View Post
      That's why I don't even try to make my (little) programs and scripts compatible with Windows. Especially when it comes to filesystem. Thank god I am not getting paid for doing this and don't try to sell anything.
      if you assume utf8 internally you can just call WideCharToMultiByte and MultiByteToWideChar to translate between utf8 and (broken) utf16​ for filesystem operations

      Comment


      • #4
        Aren't there language specific I/O APIs that abstract it already? C++, Rust and etc. have pretty good standard libraries for this. I.e. you don't often need to use OS specific level APIs unless you really want to. So what is the benefit of this that standard libraries don't provide?
        Last edited by shmerl; 17 March 2024, 01:35 AM.

        Comment


        • #5
          Originally posted by byteabit View Post
          That's why I don't even try to make my (little) programs and scripts compatible with Windows.
          Me the same. I don't even bother dealing with this mess.

          Comment


          • #6
            Since windows 10 you can use the 8-bit APIs with UTF-8, and you can ask for this at the application level.

            Comment


            • #7
              I found funny comments in the code like "!!! FIXME: Don't let this ship without async R/W support!!!" :P

              Comment


              • #8
                Originally posted by shmerl View Post
                Aren't there language specific I/O APIs that abstract it already? C++, Rust and etc. have pretty good standard libraries for this. I.e. you don't often need to use OS specific level APIs unless you really want to. So what is the benefit of this that standard libraries don't provide?
                AFAIK only Rust gets it right and in a safe manner. But at the price of having OsString, its reference type OsStr, implementing the necessary conversions, storing it as a 16-bit array of characters but verifying it at runtime to see if they are correct ( Windows simply reads a stream of bytes in 2-bytes chunks, even invalid codepoints are "valid" in the pathnames...you can imagine what disasters can happen, thing like malware using malformed UTF-16 pathnames to bypass antivirus )

                Obviously Rust cannot accept invalid sequences of codepoints, so it must go to great lengths to bust the "bad guys". Other languages don't care, meaning the programmer must take care.

                Comment


                • #9
                  When I first saw the post title, I thought, "Finally, they are putting PhysicsFS into SDL directly." Disappointed.

                  Comment


                  • #10
                    Originally posted by pabloski View Post
                    Obviously Rust cannot accept invalid sequences of codepoints, so it must go to great lengths to bust the "bad guys". Other languages don't care, meaning the programmer must take care.
                    That means Rust cannot open files with invalid filenames but C++ can.

                    Comment

                    Working...
                    X