pipe reading and file monitoring