• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Writing and Reading from a created directory

Laura Bravo

So I create a directory using directory_create(name) easy enough and it places said new directory within the working_directory. What I can't seem to figure out is how to place the path when writing and reading to do so withing the newly created directory leaving me only to write and read within the working_directory.

I realize that GS is a self contained sand box but surely there is a way to do so within folders placed in the working_directory else why be able to create said folder and destroy them.

Here is my file write line
file = file_text_open_write(working_directory + "\ " + "c_times_" + string(date_id) + ".txt")
this looks in the working_directory for a file named c_times_[ date_id goes here ].txt
I can't seem to be able to set a path that allows saving within a newly created directory within working_directory. Any ideas? I have tried some things as well as using the whole file location name but non worked so don't think it would help to list them.


Forum Staff
Remove working_directory, the backslash and especially the space after the backslash. Neither of these have a right to exist in relative file paths. Take a look at my post about how to included files for further information.

Relative file paths have the following form:
and are by default relative to the local storage or the working directory, depending on where the file exists, the former for reading and writing, the latter only for reading, prioritized in that order.

That aside, make sure to not only open, but also close your file. Closing is what writes buffered contents to disk. Opening does nothing but open the buffer.