Page 1 of 1

[solved] love.filesystem.getInfo doesn't work in fused mode (I'm stupid, delete this)

Posted: Wed May 30, 2018 5:31 pm
by 4aiman
0. Get Win 10 x64 (I've tested in that env), install love2d x64 and 7-zip.
1. Create an empty folder somewhere on an NTFS drive (haven't tried any other FS).
2. Create a file main.lua and file.txt in that folder. The file.txt may be empty - it's ok.
3. Open main.lua and add this into it

Code: Select all

print(love.filesystem.getInfo("file.txt"))
4. Run main.lua using system-wide lovec.exe and get a neat "table 0x******" logged in your terminal.
however
5. Download x86 build of love2d.
6. Extract in to the folder created in step 1.
7. Follow the wiki and create a fused file by running in a local cmd window

Code: Select all

7z a test.love -tzip main.lua
copy /b lovec.exe+test.love test.exe
8. Run test.exe and get nil instead of "table 0x******"

Note, that stuff like

Code: Select all

local _f = io.open("file.txt", "r") somevar = _f:read("*all") _f:close()
still works.
So... What gives?

Re: love.filesystem.getInfo doesn't work in fused mode

Posted: Wed May 30, 2018 5:33 pm
by bartbes
What gives is that you're not including file.txt in your .love file. So the file really isn't there in the love.filesystem VFS. And when you're using io.open (instead of love's File:open/love.filesystem.newFile), you're bypassing love.filesystem.

Re: love.filesystem.getInfo doesn't work in fused mode

Posted: Wed May 30, 2018 5:43 pm
by 4aiman
Ah, ok.
I was under impression that it was impossible to io.anything in the source dir, but when it worked I tried to use checks mixing the 2 subsystems.
Talk about learning the hard way :D
Thanks!

Re: [solved] love.filesystem.getInfo doesn't work in fused mode (I'm stupid, delete this)

Posted: Wed May 30, 2018 5:59 pm
by bartbes
Well, the io library doesn't know about games, so if it happens to work, your working directory happens to be correct and you got (somewhat) lucky. The entire point of love.filesystem is to abstract annoying filesystem differences between machines and platforms and give a single, consistent view instead, so you can rely on your game's files being available in the vfs.