Mar-29-2024, 07:48 AM
i want to have my script read a file that another process may or may not have written more to that file extending its size. in unix, the "tail -f" command does this once it has reached EOF. i want my script to read this way. imagine the script is implementing that "tail -f" command. my script will be doing something different but still needs to continuously read a status file up to the end. what i am worried about is if there is something i need to do for this in the Python I/O logic. once a file being read reaches EOF could Python save the EOF state and give EOF each time the script tries to read that file, even if the underlying file in the system has grown? is there anything in particular my script code needs to do if i use the Python I/O interface or should i just read that file via the unix system I/O interface? this project will only be running on Linux.