:
, . 'cat_desc' 'cat_asc', 'cat_ascc'.
, 'r+', , , seek ing 0 - . -.
, 'w+' ( ) - . , , , .
... . , , , , .
, - " " . , , , . , ; . ... Windows. :
with tempfile.NamedTemporaryFile(delete=False) as outfile:
with open(inpath) as infile:
os.rename(outfile.name, inpath)
, Windows . outfile, , with, , , infile outfile; . , Vista/2008 API Win32.