if you look for atomic test, you can also open files with O_CREAT | O_EXCL. Then, you can just use pid + start time + local counterunless (mkdir $dir) { -d $dir && ... dir exists; -w _ || ... not writable by euid -x _ || ... not traversable by euid }
$fh = IO::File->new ($filename, O_EXCL | O_CREAT | ...)
In reply to Re^3: Generate a unique ID
by happy.barney
in thread Generate a unique ID
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |