Access temporary / cache folder?

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
User avatar
Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

Access temporary / cache folder?

Post by Marty »

I'd like to store some volatile data on the device. This is data that my game uses or creates. This data is not required to play the game, but it helps the game somehow. It can be logs or any pre-processed files that helps the game to run faster on the 2nd attempt.

Obviously it should be platform independent. So, in Windows it will point to %temp%\LOVE, in Android and iOS it should point to the proper location, so when I empty the cache of the game, the data will be removed.

Is there any possibility to do it. If so, how?
Visual Studio Code TemplateRichLÖVE Mobile (AdMob+UnityAds+PlayGamesServices+GameCenter)Add me on Discord

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█
User avatar
erasio
Party member
Posts: 118
Joined: Wed Mar 15, 2017 8:52 am
Location: Germany

Re: Access temporary / cache folder?

Post by erasio »

Love2d has a dedicated save folder which is the only folder you can write to with love.filesystem. The location is platform independent (so different paths for different systems).

You can just create a temp folder there and clear it regularly.

Exactly what you're asking for isn't possible with love. You'll need standard lua io functions and / or libraries.
Post Reply

Who is online

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