Problem creating a file on Linux

Paul59

New member
CX Code Contributor
Joined
Dec 13, 2018
Messages
375
I'm doing this test to write out an integer to a file:

Code:
        ' open default file for output
        Local fileOut:FileStream = FileStream.Open(" cerberus://internal/world.dat", "w")
        ' write out test value
        fileOut.WriteInt(123)
        ' close file
        fileOut.Close()

According to the table in Help, I should be using the 'file' path prefix (cerberus://internal/) for FileStream.Open on GLFW but it falls over when trying to perform the write (line 84 of stream.cxs)

If I comment out the write it crashes when attempting to Close() with a memory access violation.

I'm guessing the file isn't being created...

This is on Linux and I'm writing to a subdirectory of my home folder so permissions shouldn't be an issue.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,281
Look inside your build directory if the internal folder is there somewhere close to where the executable is.
If not, then I am not surprised, that it isn't working.
 

Paul59

New member
CX Code Contributor
Joined
Dec 13, 2018
Messages
375
Thanks both - I'd tried pasting quite a few different paths in there and somehow left a space in. Doh!

For anyone else on Linux, if using a debug build a file created with that res path will be in the [build-directory]/glfw3/ /gcc_linux/Debug/internal folder. (so many folders!)
 

Paul59

New member
CX Code Contributor
Joined
Dec 13, 2018
Messages
375
Incidentally, why is the build folder incorrectly dated? I just deleted all previous builds and rebuilt but the new folder is called editor.buildv2018-12-30 - where's that date coming from?
 
Top Bottom