R
Richard
I want to atomically write to a file so have been using temporary
files and renaming:
temp = tempfile.NamedTemporaryFile(delete=False)
temp.file.write(data)
temp.file.close()
os.rename(temp.name, output_file)
This worked but after 39567 files os.rename raises an OSError: [Errno
31] Too many links
I can still create files in this directory so I doubt it is a platform
limitation.
Can you tell what is wrong? Am I not freeing the temporary file
resources properly?
thanks,
Richard
files and renaming:
temp = tempfile.NamedTemporaryFile(delete=False)
temp.file.write(data)
temp.file.close()
os.rename(temp.name, output_file)
This worked but after 39567 files os.rename raises an OSError: [Errno
31] Too many links
I can still create files in this directory so I doubt it is a platform
limitation.
Can you tell what is wrong? Am I not freeing the temporary file
resources properly?
thanks,
Richard