Robin wrote:Or, even better, putting all save games in a dedicated subfolder. (You know, like "saves/".)
I tried before posting, but received the following results:
Code: Select all
local filesTable = love.filesystem.enumerate("saves/")
for i,v in ipairs(filesTable) do
if love.filesystem.isFile(v) then
table.insert(self.mainmenu, v)
end
end
Returns nothing.
Code: Select all
local filesTable = love.filesystem.enumerate("saves")
for i,v in ipairs(filesTable) do
if love.filesystem.isFile(v) then
table.insert(self.mainmenu, v)
end
end
Returns nothing.
Code: Select all
local filesTable = love.filesystem.enumerate("/saves")
for i,v in ipairs(filesTable) do
if love.filesystem.isFile(v) then
table.insert(self.mainmenu, v)
end
end
Returns nothing.
Code: Select all
local filesTable = love.filesystem.enumerate("/saves/")
for i,v in ipairs(filesTable) do
if love.filesystem.isFile(v) then
table.insert(self.mainmenu, v)
end
end
Returns nothing.
Code: Select all
love.filesystem.setIdentity("kurosuke/saves")
local filesTable = love.filesystem.enumerate("")
for i,v in ipairs(filesTable) do
if love.filesystem.isFile(v) then
table.insert(self.mainmenu, v)
end
end
Returns everything in the root directory (of the save folder and .love file) as well as the saves directory.
Code: Select all
love.filesystem.setIdentity("/saves")
local filesTable = love.filesystem.enumerate("")
for i,v in ipairs(filesTable) do
if love.filesystem.isFile(v) then
table.insert(self.mainmenu, v)
end
end
Returns the root but not the saves directory.
Anyone care to explain what I'm doing wrong, because I don't see it. The old "bash-head-on-keyboard" strategy of coding is letting me down. (and yes, I am sure that the folder and files are there and named correctly... the returns-too-much result confirms that.)
I would like to use a save folder, because I'm already storing some configuration settings in the root of the save area, but with the above code refusing to cooperate...