Source Directory Code

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
Richyg
Prole
Posts: 9
Joined: Tue May 11, 2010 7:18 am

Source Directory Code

Post 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
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Source Directory Code

Post 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.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Source Directory Code

Post 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?
User avatar
Luiji
Party member
Posts: 396
Joined: Mon May 17, 2010 6:59 pm

Re: Source Directory Code

Post by Luiji »

I believe somewhere in the wiki it says, but I don't remember.
Good bye.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Source Directory Code

Post 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
Richyg
Prole
Posts: 9
Joined: Tue May 11, 2010 7:18 am

Re: Source Directory Code

Post 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?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Source Directory Code

Post 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
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot] and 4 guests