L
LWDIV
Guest
Hello, i can read from a .txt file located in "C:\Users\LWDIV\Documents\GameMakerStudio2\sprite to formation_array\datafiles" but i cannot write into that file. I found out that GML is creating temp folders located here "C:\Users\LWDIV\AppData\Local\GameMakerStudio2\GMS2TEMP" . Even here the .txt file is empty.
My Code is running without any errors.
Code for read (working):
var f, line;
f = file_text_open_read(working_directory + "/test.txt");
if (f != -1) {
line = file_text_read_string(f);
show_message(line);
}
Code for write (not working):
var f, line;
f = file_text_open_write(working_directory + "/test.txt");
if (f != -1) {
show_message("blubb"); //testing if the code gets into the if-statement (works!)
line = "das ist ein test";
file_text_write_string(f, line);
}
file_text_close(f);
I used google over 3 hours now but cannot find a solution.
What do i wrong?
My Code is running without any errors.
Code for read (working):
var f, line;
f = file_text_open_read(working_directory + "/test.txt");
if (f != -1) {
line = file_text_read_string(f);
show_message(line);
}
Code for write (not working):
var f, line;
f = file_text_open_write(working_directory + "/test.txt");
if (f != -1) {
show_message("blubb"); //testing if the code gets into the if-statement (works!)
line = "das ist ein test";
file_text_write_string(f, line);
}
file_text_close(f);
I used google over 3 hours now but cannot find a solution.
What do i wrong?