file_text_open_read() doesn't open file for reading with associated files

mbeytekin

Member
My code like this
if projectfile = "" || !file_exists(projectfile)
{
exit;
}
var _fname=file_text_open_read(projectfile)

...
as you see I checked file exists and then open it for reading. Normally it works, but if I try to double click my programs own associated file and automatically opens program it doesn't work.
I got projectfile string from parameter_string(1) and as I say it's a correct file path because before reading it program checks it exists or not?

error code
############################################################################################
ERROR in
action number 1
of Step Event0
for object obj_MAIN:

File is not opened for reading.
############################################################################################
--------------------------------------------------------------------------------------------
called from - gml_Script_load_project (line 49)
called from - gml_Object_obj_MAIN_Step_0 (line 186)


Have any idea?
 

mbeytekin

Member
By the way I realized this happens when associated file at outside program directory. Sandbox is disabled but if I open program via double clicking associated file program changes working directory to file's location. I don't use working_directory variable in program anywhere but I guess this problem depends to this.
 
Top