Page 1 of 1

Source Directory Code

Posted: Sun Jun 06, 2010 8:48 pm
by Richyg
I can't find it on the wiki but is there a peice of code that forces the filesystem to look at the source directory? I ask because currently my libaries are stored in the love directory and my database has to be located there. I've got it to locate the database in the user directory, which would be a half work around and is likely to be the location for my saves anyway but not the core data.

thanks

Re: Source Directory Code

Posted: Sun Jun 06, 2010 9:21 pm
by Robin
I'm not sure what you want to do, but PhysFS abstracts the two places away, so LÖVE can't see any difference between the .love and the write dir.

Re: Source Directory Code

Posted: Sun Jun 06, 2010 11:32 pm
by Jasoco
A question I've been meaning to ask but never got around to testing is which directory does Löve prefer? If both the .love file and the game's working directory both include a file with the same filename at the same location, which one does Löve load?

Re: Source Directory Code

Posted: Sun Jun 06, 2010 11:49 pm
by Luiji
I believe somewhere in the wiki it says, but I don't remember.

Re: Source Directory Code

Posted: Mon Jun 07, 2010 12:13 am
by TechnoCat
Jasoco wrote:A question I've been meaning to ask but never got around to testing is which directory does Löve prefer? If both the .love file and the game's working directory both include a file with the same filename at the same location, which one does Löve load?
Love wiki wrote:Files that are opened for read will be looked for in the save directory, and then in the game root folder (in that order). So if a file with a certain filename (and path) exist in both the .love-file and the save folder, the one in the save directory takes precedence.
http://love2d.org/wiki/love.filesystem

Re: Source Directory Code

Posted: Mon Jun 07, 2010 9:00 am
by Richyg
Robin wrote:I'm not sure what you want to do, but PhysFS abstracts the two places away, so LÖVE can't see any difference between the .love and the write dir.
Basically I want the source code to automatically look for libaries (.dll) in the source code directory and not where LOVE.exe is located. I have a database that is accessed through a libary located currently in the same directory as Love.exe but I want it in the directory of main.lua.

Where can I find info on PhysFS?

Re: Source Directory Code

Posted: Mon Jun 07, 2010 9:55 am
by Robin
Richyg wrote:Basically I want the source code to automatically look for libaries (.dll) in the source code directory and not where LOVE.exe is located. I have a database that is accessed through a libary located currently in the same directory as Love.exe but I want it in the directory of main.lua.
Well, it should never look in the same directory as the love executable, but since you're using dlls, all bets are off. I don't think LÖVE supports dll loading from the .love or write dir.
Richyg wrote:Where can I find info on PhysFS?
Let Me Duck Duck Go That For You