Issue #907 wontfix
Could you please implement a renaming function in love.filesystem, this way updating a file (e.g. savegames) can be made less risky (that is, crashes won't corrupt the file, or at least not as easily).
A typical lua example:
TMP_PREFIX = ".update_" -- for deriving temp write name from target -- writeStuff: write <what> to file named <filename> -- An error can happen at any point during execution of this and the -- old file will still be there. Even if the system crashes during -- the rename, the filesystem will either have renamed the file or -- it hasn't -- you'll either get the intact old version or the new -- one, never a half-written file or somesuch... function writeStuff( filename, what ) local f = io.open( TMP_PREFIX..filename, "w" ) f:write( str ) f:close( ) os.rename( TMP_PREFIX..filename, filename ) end