Sep-01-2020, 07:46 PM
(This post was last modified: Sep-01-2020, 07:53 PM by MysticLord.)
r+b is how I write to a file without zeroing the part between the end of my writes and the end of the file, or any other parts, correct?
When open("file,"w") is chosen, does it retain the file length and zero out everything, or does it set the file length to zero as well?
If I wanted to write to a file in "insert mode", I'd need to open it as read elsewhere, copy everything up to my write location into a separate new write-flagged file, append my changes, and then copy the rest of the read-flagged file into the write-flagged file. Is this correct?
Feels like an odd choice. Where can I find more detailed information, is there a good book on Python I/O you recommend?
When open("file,"w") is chosen, does it retain the file length and zero out everything, or does it set the file length to zero as well?
If I wanted to write to a file in "insert mode", I'd need to open it as read elsewhere, copy everything up to my write location into a separate new write-flagged file, append my changes, and then copy the rest of the read-flagged file into the write-flagged file. Is this correct?
Feels like an odd choice. Where can I find more detailed information, is there a good book on Python I/O you recommend?