note 68598 added to function.is-writable

From: Date: Thu, 03 Aug 2006 03:56:33 +0000
Subject: note 68598 added to function.is-writable
Groups: php.notes 
Request: Send a blank email to php-notes+get-115499@lists.php.net to get a copy of this message
Be careful of legolas558 dot sourceforge comma net's example, try this instead: <?php function is__writable($path) { if ($path{strlen($path)-1}=='/') return is__writable($path.uniqid(mt_rand()).'.tmp'); elseif (file_exists($path) && ereg('.tmp', $path)) { if (!($f = @fopen($path, 'w+'))) return false; fclose($f); unlink($path); return true; } else return 0; // Or return error - invalid path... } ?> ---- Server IP: 66.163.161.117 Probable Submitter: 124.177.76.38 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.is-writable.php Edit -- https://master.php.net/note/edit/68598 Del: integrated -- https://master.php.net/note/delete/68598/integrated Del: useless -- https://master.php.net/note/delete/68598/useless Del: bad code -- https://master.php.net/note/delete/68598/bad+code Del: spam -- https://master.php.net/note/delete/68598/spam Del: non-english -- https://master.php.net/note/delete/68598/non-english Del: in docs -- https://master.php.net/note/delete/68598/in+docs Del: other reasons-- https://master.php.net/note/delete/68598 Reject -- https://master.php.net/note/reject/68598 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#115499) next »