Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check file existence? #54

Open
shichen85 opened this issue Apr 13, 2022 · 3 comments
Open

How to check file existence? #54

shichen85 opened this issue Apr 13, 2022 · 3 comments

Comments

@shichen85
Copy link

shichen85 commented Apr 13, 2022

In ObjLoad

var _requestId = gdk_load_buffer(_bufferId, _filename, 0, 10);
, when I check for file existence with the GML native function file_exists(_filename), it returns false. In Series X|S module export, this is not the case. So when we are using GDKExntension, how can we query whether a file already exists in the cloud storage?

I also observed that files created with file_text_open_write() can be checked by file_exists(), but the file is not at AppData\Local\{game-name}. If I want to inspect the file, is Gamesaveutil the solution?

@nkrapivin
Copy link

With regular buffer_load_async at least, you can just check if the buffer size had grew past 1 byte after the load operation, if it didn't then the file most likely doesn't exist.

@schen623
Copy link

With regular buffer_load_async at least, you can just check if the buffer size had grew past 1 byte after the load operation, if it didn't then the file most likely doesn't exist.

Good thought. Although I am really hoping that we could just use a blocking operation instead of having to tread through an Async query.

To us, the ideal model would be that after using the GML 'xboxone_set_storage', the game can download all data in a blocking way. Then all the data can be checked synchronously with 'file_exists()'

@nkrapivin
Copy link

With regular buffer_load_async at least, you can just check if the buffer size had grew past 1 byte after the load operation, if it didn't then the file most likely doesn't exist.

Good thought. Although I am really hoping that we could just use a blocking operation instead of having to tread through an Async query.

To us, the ideal model would be that after using the GML 'xboxone_set_storage', the game can download all data in a blocking way. Then all the data can be checked synchronously with 'file_exists()'

Then you'd probably want to draw some static image with "LOADING..." on it, wait for a screen refresh and then download it synchronously, just so the QA won't notice anything suspicious. I'd do it the async way still though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants