Funky file contents when os.rename or os.remove are interrupted

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Tue Oct 10 14:44:30 EDT 2006


Russell Warren enlightened us with:
> On first pass I would think that both of those calls are single step
> operations (removing/changing an entry in the FAT, or FAT-like
> thing, on the HDD) and wouldn't result in an intermediate,
> null-populated, step, but the evidence seems to indicate I'm
> wrong...

They require multiple blocks to be written to disc, so if you're not
using a journaling filesystem, bad things can happen.

> Any insight from someone with knowledge of the internal operations
> of os.remove and/or os.rename would be greatly appreciated, although
> I expect the crux may be at the os level and not in python.

You're right about that.

Sybren
-- 
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/



More information about the Python-list mailing list