Hacker News new | past | comments | ask | show | jobs | submit login

You can do the math yourself every loop instead of asking the OS. Ask how much free space is available once at the start, track how big each file is, delete. You can sleep and check free space again at the end as a sanity check; if the free space isn't going down nearly as much as you expected report it to the user and inhibit future script executions b/c it means there's something referencing extents and your script is about to go on a rampage.



Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: