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?
And I believe you can also use sysopen to create files if they aren't there and error if they are,
You can, and O_CREAT and O_EXCL are exactly the flags the OP needs.
C:\t>set DIRCMD=/b C:\t>dir newfile File Not Found C:\t>perl -MFcntl -e "sysopen F, 'newfile', O_EXCL | O_CREAT or die" C:\t>dir newfile newfile C:\t>perl -MFcntl -e "sysopen F, 'newfile', O_EXCL | O_CREAT or die" Died at -e line 1.
|
|---|