[Worked Around]love.filesystem.exists problems

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.
User avatar
LÖVEYoungGunnaTeam
Prole
Posts: 12
Joined: Sun Jul 14, 2013 3:22 am
Location: Mars (The Darker Side)
Contact:

[Worked Around]love.filesystem.exists problems

Post 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~ :crazy:
Last edited by LÖVEYoungGunnaTeam on Sun Sep 29, 2013 6:05 pm, edited 1 time in total.
User avatar
xXxMoNkEyMaNxXx
Party member
Posts: 206
Joined: Thu Jan 10, 2013 6:16 am
Location: Canada

Re: love.filesystem.exists problems

Post by xXxMoNkEyMaNxXx »

I don't think that love filesystem can use that directory, but I'm not an expert in this area.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: love.filesystem.exists problems

Post 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?
Help us help you: attach a .love.
User avatar
LÖVEYoungGunnaTeam
Prole
Posts: 12
Joined: Sun Jul 14, 2013 3:22 am
Location: Mars (The Darker Side)
Contact:

Re: love.filesystem.exists problems

Post 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.
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: love.filesystem.exists problems

Post by slime »

You might be interested in Vapor: http://love2d.org/forums/viewtopic.php?f=5&t=40743
User avatar
LÖVEYoungGunnaTeam
Prole
Posts: 12
Joined: Sun Jul 14, 2013 3:22 am
Location: Mars (The Darker Side)
Contact:

Re: love.filesystem.exists problems

Post 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. :awesome:
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: love.filesystem.exists problems

Post 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... :)
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
LÖVEYoungGunnaTeam
Prole
Posts: 12
Joined: Sun Jul 14, 2013 3:22 am
Location: Mars (The Darker Side)
Contact:

Re: love.filesystem.exists problems

Post 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! :vamp:
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: love.filesystem.exists problems

Post 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.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: love.filesystem.exists problems

Post 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
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests