My python program is to read data from a txt file and insert data into my postgre database. The program has already started and keeps running. Then I accidently deleted the file on the disk, but the program still keeps running and inserting data into database.
Is that because when python open a file, it loads the file into memory, so that even I delete the file on the disk, it doesn't affect the running program? But my file is more than 3GB, does python really load my file into memory? I'm worrying about whether or not my data in database is correct.
Here is my code that opens the file:
f = open("/home/minjian/Documents/tweets2009-07.txt")
My operating system is:
Linux minjian-OptiPlex-9020 3.16.0-46-generic #62~14.04.1-Ubuntu SMP Tue Aug 11 16:27:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
POSIX-compliant operating systems leave the actual file data on disk until all file handles are closed, even if there are no longer any links pointing to the data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With