in reply to Using the file handle created by File::Temp to set specific file permissions
If your goal is to safely edit a file, without suffering nasty race conditions, the straightforward solution I concocted back in 2003 (and am still happy with) is to simply write a new file on the same file system ... and then use (atomic) rename to clobber the original file - but only after the new file has been successfully written. This is described in detail at:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using the file handle created by File::Temp to set specific file permissions
by mldvx4 (Hermit) on Dec 11, 2021 at 08:37 UTC |