Page 1 of 1

filesyststem isDirectory works in source, but not in .love

Posted: Tue Jan 07, 2014 6:06 am
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. :)

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

Posted: Tue Jan 07, 2014 6:14 am
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")?

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

Posted: Tue Jan 07, 2014 6:15 am
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.

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

Posted: Tue Jan 07, 2014 2:32 pm
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

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

Posted: Sun Jan 12, 2014 1:19 am
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).

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

Posted: Sun Jan 12, 2014 1:52 am
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:

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

Posted: Sun Jan 12, 2014 12:47 pm
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).

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

Posted: Tue Jan 14, 2014 5:42 am
by Peregrinati
Oh, I didn't know that about zip files. That explains some of the oddness I was seeing. Thanks!