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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
4aiman
Party member
Posts: 253
Joined: Sat Jan 16, 2016 10:30 am

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

Post 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?
Last edited by 4aiman on Wed May 30, 2018 5:44 pm, edited 1 time in total.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
User avatar
4aiman
Party member
Posts: 253
Joined: Sat Jan 16, 2016 10:30 am

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

Post 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!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 12 guests