Git Product home page Git Product logo

Comments (4)

flibitijibibo avatar flibitijibibo commented on July 19, 2024

Apparently DriveInfo doesn't even work on Mac/Linux, so it only really matters on Windows. We might need a better check on Windows, but everywhere else we don't really have any sort of check for this, and we can generally trust that the hard drive in question is going to be ready (far as I know, these functions are mostly for those 360 memory cards nobody bought). Hardcoded full paths with drive letters present a portability problem beyond our reach, as that's something that the game will definitely need to change on its end (also, I wonder how that could even work on more than a single Windows machine?).

from fna-mghistory.

3vi1 avatar 3vi1 commented on July 19, 2024

DriveInfo seems to work, somewhat, on Linux (though I get that there's no real point to it)...

[0] {/} System.IO.DriveInfo
[1] {/data} System.IO.DriveInfo
[2] {/var/chroot/saucy-i386/home} System.IO.DriveInfo
[3] {/var/chroot/saucy-i386/tmp} System.IO.DriveInfo
[4] {/run/user/1000/gvfs} System.IO.DriveInfo

Even if not, perhaps a better solution would be to have IsConnected:
-Always return true on *nix's, without even trying to call DriveInfo.IsReady.
-#if windows, return false on an exception, since that probably means a removable drive was disconnected sometime between enumeration and this call.

from fna-mghistory.

flibitijibibo avatar flibitijibibo commented on July 19, 2024

Sounds like we want something more to the tune of:

if (SDL2_GamePlatform.OSVersion.Equals("Linux") || SDL2_GamePlatform.OSVersion.Equals("Mac OS X"))
{
    return whatever; // Hmm...
}
else if (SDL2_GamePlatform.OSVersion.Equals("Windows"))
{
    // Perform proper DriveInfo check
}
throw new Exception("SDL2 platform not handled!");

from fna-mghistory.

3vi1 avatar 3vi1 commented on July 19, 2024

Yeah, that's kind of what I had in mind. When I get some time tomorrow after I finish the comment cleanup, I'll make a real patch and submit it for you to look over.

from fna-mghistory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.