Let's say I have two processes, a writer and a reader. The writer is a python process that has its stdout redirected into a file. The reader is a python process, whose goal is to read from the file, and do something with the bytes. Once it has used the bytes, it wants to shorten the file to keep it from getting too large. In other words, the file is being used as a buffer between the stdout from one file and the reader. Is it safe for the reader to use python's truncate method once it's done processing the bytes? Will this cause any problems for the writer?
Let's assume I'm only interested in Unix/Linux systems.