If disk is out of space and opening a file, micro wipes the file's content and it's settings.json file. Files still remain but their size is zero. No backups are created.
I have little disk space frequently so as a work-around I now launch micro through a small check script:
#!/bin/bash
echo "Checking disk space available..."
THRESHOLD_BYTES=$((50 * 1024 * 1024))
available_space=$(df --output=avail -B1 / | tail -n 1)
if [ "$available_space" -lt "$THRESHOLD_BYTES" ]; then
echo "Error: Not enough disk space available. Aborting."
exit 1
fi
echo "OK"
micro "$@"
If disk is out of space and opening a file, micro wipes the file's content and it's settings.json file. Files still remain but their size is zero. No backups are created.
I have little disk space frequently so as a work-around I now launch micro through a small check script:
OS: Debian Terminal: xfce4-terminal