Bug #16367: No way to get O_EXCL
| From: | asd at suespammers dot org | Date: | Sun, 31 Mar 2002 21:09:20 +0000 |
| Subject: | Bug #16367: No way to get O_EXCL | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-3702@lists.php.net to get a copy of this message | ||
From: asd@suespammers.org
Operating system: Debian GNU/Linux
PHP version: 4.1.2
PHP Bug Type: Feature/Change Request
Bug description: No way to get O_EXCL
I can't find a way to have a script create a file in a directory to be
served by Apache without exposing itself to race conditions. I can't use
tempnam because that doesn't give me control over the file extension. I
can't use file_exits because that will race. I can't use fopen because I
can't use O_EXCL|O_CREAT.
I can work around this by creating subdirectories, because mkdir fails if
the directory already exists. But putting one file per directory is hardly
ideal.
Having a way to use O_EXCL|O_CREAT --- that is, open a file for writing,
creating it, and failing if it already exists all atomicly --- would be a
big help.
--
Edit bug report at http://bugs.php.net/?id=16367&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16367&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16367&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16367&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16367&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16367&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16367&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16367&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16367&r=submittedtwice