local maindir = "myfolder" -- "mygame" -- tried both game root folder and inner folder
local success = love.filesystem.mount(cwd, maindir)
if success then
msg = "yesfused"
else
msg = "nofused"
end
local files = love.filesystem.getDirectoryItems(maindir)
msg = msg .. "\file count : "..#files
for _, filename in ipairs(files) do
msg = msg .. "\n"..filename
end
Every time I try this (above) and run the exe, I only get the files in the root directory where my .exe is. I can't seem to read "myfolder"
What am I missing ?
The example in the documentation is a bit confusing as they mount "coolgame" but then say about the path being : "C:\Program Files\mycoolgame\"
Is "coolgame" a folder inside "mycoolgame" or is there a typo here?
if love.filesystem.isFused() then -- the game will be fused if it's an .exe already
local dir = love.filesystem.getSourceBaseDirectory() -- gets the real path of the directory (or folder, same thing) that contains the .exe
local success = love.filesystem.mount(dir, "coolgame") -- mounts the above directory into the virtual filesystem within the "folder" called coolgame
if success then
-- If it was successful, now you can refer to stuff next to your .exe as "coolgame/whatever"; if you have a directory called myfolder, you'd do
local files = love.filesystem.getDirectoryItems('coolgame/myfolder') -- and it'd return everything inside the myfolder directory that's next to your .exe
end
end
The example says that it mounted the real path that could be that C:/Program Files/mycoolgame onto the virtual filesystem that löve uses with the name coolgame; forget about the real filesystem, that was only used to mount the containing folder, you want to use the virtual filesystem stuff, since love.filesystem uses that as well. They are basically the same directory, one's just the name of the virtual mountpoint.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
I don't think that works if it's fused since the game directory would be in the .love, which is fused to the love (or lovec) executable, hence the game dir would be inside the exe itself.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
zorg wrote: ↑Sun Apr 22, 2018 1:45 pm
I don't think that works if it's fused since the game directory would be in the .love, which is fused to the love (or lovec) executable, hence the game dir would be inside the exe itself.
Ah, right. In this case you need to do it like this:
zorg wrote: ↑Sun Apr 22, 2018 1:45 pm
I don't think that works if it's fused since the game directory would be in the .love, which is fused to the love (or lovec) executable, hence the game dir would be inside the exe itself.
Ah, right. In this case you need to do it like this:
love.filesystem.mount(love.filesystem.getSourceBaseDirectory(), 'mygame')
local files = love.filesystem.getDirectoryItems('mygame/myfolder')
Edit: ...just as you wrote above, sigh. Sorry.
No worries, i guess we could write this off as an even exchange for my blunder in the color precision thread
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.