I'm working on writing to a file and loading it to act as a save feature. It works but I have a few of questions.
What's the difference between using love.filesystem.write() and using a File object to write (File:write())?
When I use either of these functions it does work when I read the file in LOVE, but when I open up the file in File Explorer (in the .love folder) it's still the same with none of the newly written data in it. Why does it do that?</t>
Filesystem Loading and Writing Questions
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- LudvickToba
- Prole
- Posts: 16
- Joined: Wed Jan 11, 2017 9:51 pm
Re: Filesystem Loading and Writing Questions
A File object gives you random access to the data, allowing you to seek and read/write arbitrary sized blocks of data at random positions, or to append at the end of the file. You can pass the File object around if required. If you want to save or load large files that don't fit into memory at once, File is your friend.LudvickToba wrote: ↑Wed May 29, 2019 3:41 am What's the difference between using love.filesystem.write() and using a File object to write (File:write())?
love.filesystem.write can only write a whole file at once and always replaces existing files with the same name. It is useful to write monolithic blocks of data from memory to disk.
Files are always created in the save folder. The documentation explains this right at the top.When I use either of these functions it does work when I read the file in LOVE, but when I open up the file in File Explorer (in the .love folder) it's still the same with none of the newly written data in it.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests