playlist lost when disk is full after game is started
Description
when the disk which contains the retroarch home dir and it's lpl database files is full, loading any game will result in a deleted playlist.
Expected behavior
after loading a game from a playlist, the playlist should stay available even when the disk is currently full.
Actual behavior
after selecting a game, retroarch seems to want to update the playlist file with "number of times played" or a similar information, and when the disk is full writing the file back fails, leaving it empty.
Steps to reproduce the bug
- put full mame rom set (zip in zip!) on the slow SD card in your raspberry pi
- scan the directory containing it
- come back to the pi 24 hours laters when retroarch has hopefully finished writing the MAME playlist.
- in a terminal, type:
dd if=/dev/zero of=$HOME/.config/retroarch/filler.dat bs=1M - start retroarch
- wait until dd task finishes when disk/SD card is full
- select a game in your mame playlist, run it
- quit the game and go back to your mame playlist - it is now empty!
alternative smaller steps to reproduce
- create a manual playlist with 1 game
- continue with point 4 above
Version/Commit
You can find this information under Information/System Information
- RetroArch: 1.19.1
Environment information
- OS: Linux/X11
- Compiler: not relevant
If you have a full disk, you'll likely have lots of issues using your machine, let alone RetroArch. What is causing your disk to fill up?
needed to free up an SD card, so i mounted it and copied the roms on it to the device as root (on linux, root can access the entire storage, but regular users only 95% or so). therefore i didnt notice that i was above the "disk full for regular user quota".
most other programs are wellbehaving when ENOSPC happens - they just display an error message and stop the task they were about to do.
but really, this question appears odd as we're in rom land, where the full USA PSX romset already takes > 1 TERABYTE. many users use a dedicated rpi for retroarch, and afaik it supports only microsds up to 256gb.
btw it gets better than the above - if you exit retroarch while there's no space available and have "save settings on exit" ticked, then your entire retroarch.cfg gets wiped too. the sane thing to do before any overwrite is to atomically rename the old file to .bak or whatever, then write the new file, and if it fails move the old file back and display a notice. that would also be helpful if you try to do a savestate while the disk is full, rather than failing silently (i havent tested that yet but i'd guess that's what happens).