in reply to Re: What's the best way to avoid name collisions when creating files?
in thread What's the best way to avoid name collisions when creating files?
There's a cavat to flock though. It doesn't work across the network . If you know that you're always going to use the local file system, then great. However if you move to a NAS, flock may stop working.
I ran into this with DBD::CSV. DBD::CSV will use flock under the hood to ensure that it has exclusive access to the file it is reading/writing. However if the file is on a NAS (Network Area Storage) and accessed with NFS, then DBD::CSV will fail to open the file.
|
|---|