in reply to Unique filename

This generates a classic race condition. To avoid that you need to have this function open the file with the O_EXCL flag specified and then retry with the next free file name if that fails.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
`Re: (tye)Re: Unique filename
by tachyon (Chancellor) on May 24, 2001 at 10:42 UTC

    Hmm, I have to concur. Just wrapped the code around the regex without sufficient thought. Given that its function it should really pass back a locked filehandle for writing. On the to do list

    $\=' '; sub AUTOLOAD{@_=caller();print shift} package Back;&::; package To;&::; package The;&::; package Drawing;&::; package Board;&::;
    tachyon