Page 1 of 2
[Worked Around]love.filesystem.exists problems
Posted: Thu Sep 26, 2013 8:47 pm
by LÖVEYoungGunnaTeam
I just need help for a simple code file that will check in the "C:\Program Files (x86)\LOVE" directory to check if "love.exe" exists, because i can't seem to get it to work. I know this is a really stupid question, but any and all help is needed. Thanks~
Re: love.filesystem.exists problems
Posted: Thu Sep 26, 2013 11:11 pm
by xXxMoNkEyMaNxXx
I don't think that love filesystem can use that directory, but I'm not an expert in this area.
Re: love.filesystem.exists problems
Posted: Thu Sep 26, 2013 11:34 pm
by Robin
love.filesystem is only for the .love (for reading) and for the save directory (for reading and writing).
Why do you need to know if love.exe exists?
Re: love.filesystem.exists problems
Posted: Thu Sep 26, 2013 11:48 pm
by LÖVEYoungGunnaTeam
I was going to use the LOVE api to try to create a "steam-like" program, and i was going to check to see if that computer could run .love files, but thanks guys.
Re: love.filesystem.exists problems
Posted: Fri Sep 27, 2013 12:00 am
by slime
Re: love.filesystem.exists problems
Posted: Fri Sep 27, 2013 12:02 am
by LÖVEYoungGunnaTeam
Thanks slime, that was where i got the idea (other than Steam itself). Thanks for the help guys, i'll try to find a work-around. And know i know the limits of LOVE functions.
Re: love.filesystem.exists problems
Posted: Fri Sep 27, 2013 12:22 am
by davisdude
You could make a file (probably easier in another language) that gets their os (using love.os) then packages it properly and does it only once. That way it would only have to load once. Complicated, but it could work...
Re: love.filesystem.exists problems
Posted: Fri Sep 27, 2013 12:28 am
by LÖVEYoungGunnaTeam
i found a way of running a batch file (very easy language!) that does a "if exist" command from a Lua file. Thank Jesus for the "os.execute" command!
Re: love.filesystem.exists problems
Posted: Fri Sep 27, 2013 1:33 am
by davisdude
You may still want to use the love.os to execute a specific file. Batch files are only for Windows. It is an easy language, though.
Re: love.filesystem.exists problems
Posted: Fri Sep 27, 2013 1:34 am
by Azhukar
http://lua-users.org/wiki/IoLibraryTutorial
Code: Select all
local function fileExists(filePath)
local success = io.open(filePath,"r")
if (success) then io.close(success) end
return not not success
end