I have a perl program running in windows that forks a child process. The child process opens a file handle $fh and starts some work with the file.
A short while later the parent forks a second child process. Much to my surprise the file opened in the first child is also opened in the second child according to process explorer (although I doubt the file handle created in the first child is shared) The first child finishes its work and closes the file handle and finishes. Annoyingly though the file stays open till the second child has completed and finished. I don't want this. The files are temporary and I need to be able to delete them without another child locking them.
I know that file handles are passed from parent to child processes. I wasn't expecting anything created in 1 child being locked by the second though.
Any help much appreciated.
In reply to File handles with forked processes by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |