in reply to Re^2: Filenames based on timestamp
in thread Filenames based on timestamp

that's true. you could work around that by also included a PID in the filename.
while(-e "$time_$$_$counter") { $counter++; } open(F, ">$time_$$_$counter");
of course, then the filenames won't necessarily be in ascending order chronologically.

Replies are listed 'Best First'.
Re: Re: Re: Re: Filenames based on timestamp
by seanpor (Novice) on Jul 23, 2002 at 13:18 UTC
    what about multiple threads :-)

    page 572-574 of camel3 suggests something along the lines of...
    $fn = "filename_20020723141223_"; my $c = 1; do { $fn .= "$c"; $c++; } until sysopen(FH, $fn, O_RDWR | O_CREAT | O_EXCL, 0600); # now do I/O using $fh handle...