Page 1 of 2

various file system questions

Posted: Sun Apr 26, 2015 2:28 pm
by raingloom
First of all: love.graphics.newImage(path) can't seem to open anything outside the current directory. Am I doing something wrong? (so far only tested on Windows 7)
I need it to open any file for a vertex editor. (render an image as background, then the user can make a polygon over it. it sucks having to move the image file :E)

Second: for the previously mentioned project I made a library for handling various vertex functions (loading/saving, automatic UV, bounding box/quad, etc)
I moved it into a separate directory which I want to use for my libraries. I deleted the original in the vertex editor's directory and made a symlink to it. Now require"verts" fails, also I can't open the symlink in ZBStudio, but that's a different matter.
The file system is an external HDD formatted with NTFS and everything has rwx access. (Configured with Ntfs-tools)
Running Ubuntu 14.10 x64.

Re: various file system questions

Posted: Sun Apr 26, 2015 9:04 pm
by Robin
love.filesystem is contained to the .love (or game directory) and the write directory.

Re: various file system questions

Posted: Sun Apr 26, 2015 9:31 pm
by Nixola
Love.filesystem as well as any LÖVE loading function

Re: various file system questions

Posted: Sun Apr 26, 2015 10:58 pm
by s-ol
If you gain access to the image in some other way you can create an ImageData from the data itself.

Re: various file system questions

Posted: Mon Apr 27, 2015 8:57 am
by Nixola
Yes, but the loading function themselves don't provide access to external folders

Re: various file system questions

Posted: Tue Apr 28, 2015 1:52 am
by s-ol
Nixola wrote:Yes, but the loading function themselves don't provide access to external folders
Yeah, like I said there are other ways of opening files than love.filesystem. with those you can access other files.

Re: various file system questions

Posted: Tue Apr 28, 2015 2:07 am
by I~=Spam
To open files elsewhere use the functions that are built into lua (they are harder to use though). Or you can just use this ;) viewtopic.php?f=5&t=9479

Re: various file system questions

Posted: Wed Apr 29, 2015 9:47 am
by raingloom
I know Lua's io functions, so I assumed require would work.
I have tried passing a file handle to the newImage function, but of course it did not work. An ugly workaround could be making a local copy.

What I still don't get is why my symlink is not working?

Re: various file system questions

Posted: Wed Apr 29, 2015 5:48 pm
by I~=Spam
Use the link I gave you. It does ALL the work for you. It work perfectly!

Re: various file system questions

Posted: Thu Apr 30, 2015 1:10 am
by raingloom
I've checked it, but for something as simple as loading my modules, I didn't want to include another module in each project. I think I'll use it for the editor's file loading though.
Of course no one thought of the most obvious solution:

package.path=package.path..";../Libs/?.lua"

...like seriously, I feel so stupid right now.