Help with love.filesystem.write

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
ttmso
Prole
Posts: 1
Joined: Tue Aug 29, 2023 10:35 am

Help with love.filesystem.write

Post by ttmso »

I'm making a game and it keeps giving a error when i try to save a file there "Could not open file maps/test.json (not found)".
The folder/file exists and the file ident is the folder that the files are in, btw my OS is Windows 10 Pro

Here is the line that give that error:
local success, error = love.filesystem.write("maps/" .. name .. ".json", map_)
User avatar
pgimeno
Party member
Posts: 3642
Joined: Sun Oct 18, 2015 2:58 pm

Re: Help with love.filesystem.write

Post by pgimeno »

Löve can and will only write to save directories. Are you sure the folder "maps/" exists in the save directory?

You can find out which directory is the save directory by placing this at the top of main.lua and observing the error message:

Code: Select all

error("The save directory is " .. love.filesystem.getSaveDirectory())
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 3 guests