FileStream

This topic contains 7 replies, has 3 voices, and was last updated by  Jesse 2 years ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7614

    Jesse
    Participant

    I am having a hard time opening a file with “Filestream”. I added the file to the Import and opened it like this

    [/crayon]

    but it doesn’t seem to work. I also tried it without inserting “asset::” but still doesn’t work and without #Import adding the file myself to the folder where the executable is and still nothing. all I get is the Runtime Error.

    this is on Mac OS X Sierra.

    #7615

    impixi
    Participant

    Try this:

    [/crayon]
    #7616

    Jesse
    Participant

    That did it! Thanks.
    Personally, I think games should just default to the assets dir but what do I know.

    #7632

    Mark Sibly
    Keymaster

    Ok, The ‘asset::’ prefix (and other such ‘::’ prefixs) should only be used with Stream.Open, eg:

    Loadl dataIn:=Stream.Open( “asset::table.data”,”r” )

    Assets are not always stored in filesystem directories, so an ‘asset stream’ is not always a FileStream.

    Personally, I think games should just default to the assets dir but what do I know.

    The problem with that then becomes how do specify ‘current dir’, eg: if “table.data” means a file in assets storage (not necessarily a dir) then you’d need a different way to specify a file in the current dir – perhaps force people to prefix files in current dir with CurrentDir()+blah, which is gonna annoying a differet set of people! Or perhaps even ‘cd::’ – dunno, if you’ve got any ideas go ahead and let me know…!

    #7634

    Jesse
    Participant

    No idea of how it should have been done. I tried what I thought was intuitive but none of my attempts worked. That’s why I made that statement. I just thought that a default dir for all assets/data would be a good idea just like in Monkey1 and it somebody wants to store their data in a different folder than you would go through more complicated steps. I don’t know if it’s a great or bad idea. it’s just that I got used to the way Monkey1 works. Thanks either way for taking the time Mark.

    #7636

    impixi
    Participant

    On iOS and MacOS, assuming I understand the information in this link:

    https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

    Persistent user-specific files like app configuration and save game files should be stored in the user’s Library folder.

    eg:
    Users/Dude/Library/Application Support/TheGame/options.cfg
    Users/Dude/Library/Application Support/TheGame/save001.dat
    etc..

    #7637

    Mark Sibly
    Keymaster

    That’s why I made that statement.

    No problem and thanks for the input – hope you don’t think I was hassling, just responded with ‘problems as I see it’ etc and threw some ideas around. I actually don’t remember how monkey1 did it, must have another look!

    #7638

    Jesse
    Participant

    Thanks @impixi, It kind of makes sense. I have some applications that use that set up. I am just wondering where would data for a maze would go? I am guessing in the game asset folder but I wouldn’t know?

    @Mark

    hope you don’t think I was hassling,

    No not at all. Other times I have but not this time. 😉

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

You must be logged in to reply to this topic.