RE: checking for existence of a file.

2001-09-21 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 21, John Edwards said: >do { > $artikelID = &newID; >} until (! -e $ARTIKEL_DIR.$artikelID); That produces a race condition. Between the checking for the existence of the file, and the opening of the file itself, the file COULD be created. I suggest the use of the sysopen() function.

RE: checking for existence of a file.

2001-09-21 Thread John Edwards
king for existence of a file. I have a subroutine &newID that constructs a pseudo-random ID on every invocation. Regularly, a file needs to be created in a directory, say $ARTIKEL_DIR, using a newly generated ID. Of course, I want to make sure that the file (the ID) doesn't exist yet.

checking for existence of a file.

2001-09-21 Thread Martijn van Exel
I have a subroutine &newID that constructs a pseudo-random ID on every invocation. Regularly, a file needs to be created in a directory, say $ARTIKEL_DIR, using a newly generated ID. Of course, I want to make sure that the file (the ID) doesn't exist yet. Of course, I could put all IDs previou