Need to access the file system, so using love.filesystem.directorydropped() to do so. It works just fine on a Mac, but fails under Windows.
I’ve condensed the problem code to a single function:
Code: Select all
function love.directorydropped(folder)
local fileseparator = package.config:sub(1,1)
local mountpoint = "folder"
print "folder dropped "
local mount = love.filesystem.mount(folder, mountpoint)
print("mounted ", mount)
local dir = love.filesystem.getDirectoryItems(mountpoint)
for i, item in ipairs(dir) do
print(i, item)
end
local filename = dir[1]
local path = mountpoint .. fileseparator .. filename
local file, errorstr = love.filesystem.newFile(path, 'r')
print(tostring(file))
print(errorstr)
end
Running on widows and dropping a folder with three files in it gives the following.
Code: Select all
folder dropped
mounted true
1 a.txt
2 b.txt
3 c.txt
nil
Could not open file folder\a.txt. Does not exist.
An help/insights much appreciated.
Tony