note 58528 added to function.ftp-nlist

From: Date: Mon, 07 Nov 2005 15:10:36 +0000
Subject: note 58528 added to function.ftp-nlist
Groups: php.notes 
Request: Send a blank email to php-notes+get-98196@lists.php.net to get a copy of this message
Recursive directory delete using ftp_nlist() ... <?php function ftp_rmdirr($path, $handle) { if (!(@ftp_rmdir($handle, $path) || @ftp_delete($handle, $path))) { $list = ftp_nlist($handle, $path); if (!empty($list)) foreach($list as $value) ftp_rmdirr($value, $handle); } @ftp_rmdir($handle, $path); } ?> It would be very useful if it was built into php. After all most of the time we want to remove non empty directories too. I bet everyone out there dealing with the file system had faced this problem. ---- Manual Page -- http://www.php.net/manual/en/function.ftp-nlist.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58528 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58528&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58528&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98196) next »