Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wipes the file and settings.json if disk is full. #3196

Open
v972501 opened this issue Mar 20, 2024 · 1 comment · May be fixed by #3273
Open

Wipes the file and settings.json if disk is full. #3196

v972501 opened this issue Mar 20, 2024 · 1 comment · May be fixed by #3273

Comments

@v972501
Copy link

v972501 commented Mar 20, 2024

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 "$@"

OS: Debian
Terminal: xfce4-terminal

@dmaluka
Copy link
Collaborator

dmaluka commented Mar 20, 2024

Yes, it is a known major issue: #3148

@JoeKar JoeKar linked a pull request Apr 28, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants