filesyststem isDirectory works in source, but not in .love

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
Peregrinati
Prole
Posts: 4
Joined: Sun Dec 08, 2013 7:26 am

filesyststem isDirectory works in source, but not in .love

Post by Peregrinati »

Hello,

Hopefully this is just a n00b mistake someone will be able to clear up no sweat. When running my game with 'love .' in the root directory works just fine. However, when I create the .love file and try to run that I'm finding that the line 'love.filesystem.isDirectory(path)' is now returning false instead of true, causing one of my assert statements to fail.

I'm 99.9% sure I'm creating the .love correctly. It loads love, and I get the skyblue window with the traceback to my assert in white. If I unzip the .love into another directory, I can enter it and run 'love .' and have everything work again.

I am trying to run the .love in windows, and I'm running 'love .' in linux, so maybe that's related. I tried flipping the path separators around to no avail (/ to \), but I didn't think that was the issue anyway since my understanding is that love code is supposed to be cross platform.

Thanks for any light you can shed. :)
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: filesyststem isDirectory works in source, but not in .lo

Post by slime »

Does the path string in your isDirectory call match the case of the real path inside the .love (e.g. "Myfolder" vs "myfolder")?
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: filesyststem isDirectory works in source, but not in .lo

Post by veethree »

We could probably shed more light if you provided the .love file in question so we can test it out ourselves and look at the code.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: filesyststem isDirectory works in source, but not in .lo

Post by Nixola »

slime wrote:Does the path string in your isDirectory call match the case of the real path inside the .love (e.g. "Myfolder" vs "myfolder")?
It probably does, since he runs the folder in Linux
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Peregrinati
Prole
Posts: 4
Joined: Sun Dec 08, 2013 7:26 am

Re: filesyststem isDirectory works in source, but not in .lo

Post by Peregrinati »

slime wrote:Does the path string in your isDirectory call match the case of the real path inside the .love (e.g. "Myfolder" vs "myfolder")?
That was it. Part of the string was "testMap", but the real path was "testmap". I'm uncertain why this worked on linux (which is case sensitive, hence the two paths shouldn't match) but not in windows (which is case insensitive, and the two paths should have).
Peregrinati
Prole
Posts: 4
Joined: Sun Dec 08, 2013 7:26 am

Re: filesyststem isDirectory works in source, but not in .lo

Post by Peregrinati »

Oh, you know what? It's because I'm running linux in a VM, and mounting folders from the host OS (windows) and drive (NTFS). So the underlying file system is case sensitive, but the OS doesn't think it is... maybe? I got some strange behaviour when I tried to rename it to the same thing with a different case. Regardless, not a love problem at all - thanks for the help though! :awesome:
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: filesyststem isDirectory works in source, but not in .lo

Post by bartbes »

Oh yeah, mounts like that should do that. About case-sensitivity on windows, there is none, but zip files are case-sensitive (and therefore love files).
Peregrinati
Prole
Posts: 4
Joined: Sun Dec 08, 2013 7:26 am

Re: filesyststem isDirectory works in source, but not in .lo

Post by Peregrinati »

Oh, I didn't know that about zip files. That explains some of the oddness I was seeing. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests