I want to copy a file and start writing a new file:
shutil.copyfile("largefile","newlargefile")
nwLrgFile=open("newlargefile",'a')
nwLrgFile.write("hello\n")
However, when I do the above, it hellowill be written to the end of the file. What is the correct way to make a copy of a file?
I looked at SO and other places, but all the answers I saw said that shutil.copyfile is blocking or blocking and that this should not be a problem. And yet, this is so. Please, help!
source
share