Code: Select all
mapfile = love.filesystem.newFile("filename.txt", love.file_write)
love.filesystem.open(mapfile)
love.filesystem.write(mapfile, "blah")
love.filesystem.close(mapfile)
Loading works too.
Code: Select all
mapfile = love.filesystem.newFile("filename.txt", love.file_write)
love.filesystem.open(mapfile)
love.filesystem.write(mapfile, "blah")
love.filesystem.close(mapfile)
This doesn't make sense to me because when I ran that same line without the contained assertion stderr.txt didn't give me an error (this could just be some weird case of lua not noticing an error or something).bartbes wrote:No, it actually says love.filesystem.open failed
Code: Select all
file = io.open ("maps/test.txt","w")
file:write("Hello World\n2nd line")
file:close()
file = io.open("maps/test.txt","r")
content = file:read("*a")
file:close()
Code: Select all
mapfile = love.filesystem.newFile("filename.txt", love.file_write)
love.filesystem.open(mapfile)
love.filesystem.write(mapfile, "blah")
love.filesystem.close(mapfile)
Sparx wrote:If i use the code as is, the file is not edited. If I use a subdirectory the game closes imidiately.
Users browsing this forum: Amazon [Bot] and 5 guests