FileExists() for all targets?

About Monkey 2 Forums Monkey 2 Programming Help FileExists() for all targets?

This topic contains 2 replies, has 2 voices, and was last updated by  Diffrenzy 1 year, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8136

    Diffrenzy
    Keymaster

    Is there a way to check if a file exists (on all targets) ?

    I’ve been trying GetFileType(“asset::myfile.txt”)<> FileType.None , but I don’t think I’m getting correct results.

    #8137

    Mark Sibly
    Keymaster

    Try: GetFileType( AssetsDir()+”myfile.txt” )

    There’s a bit of a mismatch between ‘stream paths’ and ‘filesystem paths’ at the moment, ie: ‘asset::’ only works when opening a stream, but things like GetFileType, GetFileTime etc work with filesystem paths. It should probably work everywhere (where possible – assets aren’t always stored in the filesystem) but there are other issues with filesystem paths and soft/hard links that also need to be dealt with. Feel free to add an issue referencing this post though.

    #8160

    Diffrenzy
    Keymaster

    I’ll let tinyXML, fail and report error for now, that seems stable.

    Will post this to github

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.