I am writing a long-running program in the Linux environment that will be calculating entries in a large table. Every time it comes to the end of the row, it outputs the calculated values into a plaintext file.
To avoid having to continually reopen the file and append to it, I am considering just opening the file once and holding it open for the duration of the program.
I know that there is a limit on the maximum number of file descriptors that can be open at once, but is there a time limit on a single file descriptor being held for an extended period of time?
Note: The process I am running could potentially take a month or more to complete.
init
) without which the system cannot run. – Stéphane Chazelas Nov 04 '14 at 07:02