note 53790 added to function.tempnam
| From: | chris at osu1 dot php dot net | Date: | Mon, 13 Jun 2005 16:23:44 +0000 |
| Subject: | note 53790 added to function.tempnam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90359@lists.php.net to get a copy of this message | ||
Use the following to create a temporary directory...
// Creates a directory with a unique name
// at the specified with the specified prefix.
// Returns directory name on success, false otherwise
function tmpdir($path, $prefix)
{
// Use PHP's tmpfile function to create a temporary
// directory name. Delete the file and keep the name.
$tempname = tempnam($path,$prefix);
if (!$tempname)
return false;
if (!unlink($tempname))
return false;
// Create the temporary directory and returns its name.
if (mkdir($tempname))
return $tempname;
return false;
}
----
Manual Page -- http://www.php.net/manual/en/function.tempnam.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53790
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53790&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53790&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53790&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53790&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53790&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53790&report=yes
Search -- http://master.php.net/manage/user-notes.php