[solved] problem with the path from getSaveDirectory
Posted: Sat Mar 21, 2015 5:04 pm
Hi,
I tried to read some files at start, which are saved in the standard-save-directory of love2d. The directory exists and I managed to write some file there, also.
The files are known by the engine, for example with this code from the wiki:
all file-names (of the save-directory AND of the directory, where the main.lua-file is) are listed in the console.
Now I wanted (as I need) the files only, which are in the save-directory.
I tried
and
but both paths do not exist?
(I tested this with love.filesystem.exists, which returns a true or false)
Is there a hint, how I could handle this? Is there a problem with the paths if I use windows (instead of linux?) My username has no "special" characteres...
Thanks for reading so far :-)
EDIT: Solved, thanks a lot!!
I tried to read some files at start, which are saved in the standard-save-directory of love2d. The directory exists and I managed to write some file there, also.
The files are known by the engine, for example with this code from the wiki:
Code: Select all
local dir = ""
local files = love.filesystem.getDirectoryItems(dir)
for k, file in ipairs(files) do
print(k .. ". " .. file) --outputs something like "1. main.lua"
end
Now I wanted (as I need) the files only, which are in the save-directory.
I tried
Code: Select all
local str_path = "file://"..love.filesystem.getSaveDirectory()
Code: Select all
local str_path = love.filesystem.getSaveDirectory()
(I tested this with love.filesystem.exists, which returns a true or false)
Is there a hint, how I could handle this? Is there a problem with the paths if I use windows (instead of linux?) My username has no "special" characteres...
Thanks for reading so far :-)
EDIT: Solved, thanks a lot!!