Changing the save directory

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.
Bicentric
Prole
Posts: 28
Joined: Fri Jul 12, 2013 12:17 pm

Changing the save directory

Post by Bicentric »

-
Last edited by Bicentric on Tue Jun 19, 2018 7:30 pm, edited 1 time in total.
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Changing the save directory

Post by ejmr »

The string you use for the identity will be the name of the directory where LÖVE will write your files. However, LÖVE has restrictions on where you can work with files. It only allows you to write files in the 'save directory' which uses the name of the identity. But the location of that directory depends on the operating system and you cannot do something like try setting the identity to an absolute path. This page has more details about LÖVE and files:

http://love2d.org/wiki/love.filesystem
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
Bicentric
Prole
Posts: 28
Joined: Fri Jul 12, 2013 12:17 pm

Re: Changing the save directory

Post by Bicentric »

-
Last edited by Bicentric on Tue Jun 19, 2018 7:30 pm, edited 1 time in total.
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Changing the save directory

Post by ejmr »

Bicentric wrote:With that being said I change my original question, what would be the best way of saving files to a directory across both operating systems?
There is nothing you need to do in order to save files on different operating systems. LÖVE knows where to put them and hides a lot of those details when reading and writing files so that you don’t have to worry about it. If you want to know where those directories are you can use the functions I mention below.
Bicentric wrote:Or is there a way to overcome this and be able to save my files to an absolute path?
As far as I know you can’t do that, but I could be wrong. You can use love.filesystem functions to get information about absolute paths, e.g. anything in the form of love.filesystem.get*Directory(). But you can’t use that to start saving your files in those directories.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
RedGuff
Prole
Posts: 9
Joined: Tue Mar 09, 2021 4:24 pm

Re: Changing the save directory

Post by RedGuff »

This system is bad: impossible to make utility programs.
User avatar
dusoft
Party member
Posts: 531
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Changing the save directory

Post by dusoft »

RedGuff wrote: Sat Jan 29, 2022 5:34 pm This system is bad: impossible to make utility programs.
You can always use lua filesystem functions on top of anything that LÖVE offers.
User avatar
GVovkiv
Party member
Posts: 678
Joined: Fri Jan 15, 2021 7:29 am

Re: Changing the save directory

Post by GVovkiv »

RedGuff wrote: Sat Jan 29, 2022 5:34 pm This system is bad: impossible to make utility programs.
as was mentioned, you can use lua's io or change love's source to add this functionaity
but, why you want to use game framework to make programs?
aren't there no tools for that?
User avatar
zorg
Party member
Posts: 3449
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Changing the save directory

Post by zorg »

Maybe because someone wants to? I do that too because it's still simpler than learning anything new to code a non-game app.

Also, you can use NativeFS that's been rehosted here: https://github.com/EngineerSmith/nativefs
(also gg bumping a thread from 2013)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
GVovkiv
Party member
Posts: 678
Joined: Fri Jan 15, 2021 7:29 am

Re: Changing the save directory

Post by GVovkiv »

zorg wrote: Sun Jan 30, 2022 11:19 am Maybe because someone wants to? I do that too because it's still simpler than learning anything new to code a non-game app.

Also, you can use NativeFS that's been rehosted here: https://github.com/EngineerSmith/nativefs
(also gg bumping a thread from 2013)
(also gg bumping a thread from 2013)
like something bad
RedGuff
Prole
Posts: 9
Joined: Tue Mar 09, 2021 4:24 pm

Re: Changing the save directory

Post by RedGuff »

Thanks all of you.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests