G
Guest
Guest
I check for the existence of a file and, if it does not exist, create it, like so:
But running on an iPad using the VM and debugger, I get these errors and this output:
When I reboot the iPad (to close the game) and try to open the game, it hangs on a black screen rather than running correctly.
(I'm getting this problem with all my file functions, this was just the simplest example I had to copy and paste.)
Code:
global.privacy_consent = false;
if (!file_exists("privacy_consent.bhsl"))
{
show_debug_message("* Privacy_consent.bhsl did not exist, creating it.");
var privacy_consent_map = ds_map_create();
privacy_consent_map[? "consent"] = false;
var privacy_consent_map_string = ds_map_write(privacy_consent_map);
var f = file_text_open_write("privacy_consent.bhsl");
file_text_write_string(f, privacy_consent_map_string);
file_text_close(f);
ds_map_destroy(privacy_consent_map);
}
if (file_exists("privacy_consent.bhsl"))
{
show_debug_message("* Reading privacy_consent.bhsl.");
var f = file_text_open_read("privacy_consent.bhsl");
show_debug_message("* Should have successfully opened privacy_consent.bhsl.");
var privacy_consent_map_string = file_text_read_string(f);
var privacy_consent_map = ds_map_create();
ds_map_read(privacy_consent_map, privacy_consent_map_string);
global.privacy_consent = privacy_consent_map[? "consent"];
file_text_close(f);
ds_map_destroy(privacy_consent_map);
}
Code:
2019-07-24 10:37:44.615800-0700 BHSL[251:4819] * Privacy_consent.bhsl did not exist, creating it.
2019-07-24 10:37:44.619488-0700 BHSL[251:4819] * Reading privacy_consent.bhsl.
2019-07-24 10:37:44.619724-0700 BHSL[251:4819] Unable to open file (No such file or directory)
2019-07-24 10:37:44.621225-0700 BHSL[251:4819] * Should have successfully opened privacy_consent.bhsl.
(I'm getting this problem with all my file functions, this was just the simplest example I had to copy and paste.)
Last edited by a moderator: