Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a PHP Expert!

Join 244,268 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,187 people online right now. Registration is fast and FREE... Join Now!




Directory

 
Reply to this topicStart new topic

Directory, deletion of dirs

ajaycode
17 Aug, 2008 - 09:54 PM
Post #1

New D.I.C Head
*

Joined: 9 Aug, 2008
Posts: 43

hello Every body

i worte the code directory deltion folders subfolders i run dis code
it shows erorrs i.e




output:
PHP Warning: unlink(/Dummy/Slow/New Text Document.txt) [function.unlink]: Permission denied in C:\Inetpub\wwwroot\Untitled-1.php on line 14 PHP Warning: rmdir(/Dummy/Slow) [function.rmdir]: Permission denied in C:\Inetpub\wwwroot\Untitled-1.php on line 32


the code is-----

<?php
//echo "Inteput/wwwroot/";
function rmdirr($dirname)
{

// Sanity check
if (!file_exists($dirname)) {
echo "no directory by that name";
return false;
}

// Simple delete for a file
if (is_file($dirname)) {
return unlink($dirname);
}

// Loop through the folder
$dir = dir($dirname);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}

// Recurse
rmdirr("$dirname/$entry");
//print "rmm";
}// end while looping

// Clean up
$dir->close();
return rmdir($dirname);

}

rmdirr("/Dummy/Slow");






output:
PHP Warning: unlink(/Dummy/Slow/New Text Document.txt) [function.unlink]: Permission denied in C:\Inetpub\wwwroot\Untitled-1.php on line 14 PHP Warning: rmdir(/Dummy/Slow) [function.rmdir]: Permission denied in C:\Inetpub\wwwroot\Untitled-1.php on line 32


pls helpme very argent


User is offlineProfile CardPM
+Quote Post


pemcconnell
RE: Directory
18 Aug, 2008 - 12:11 AM
Post #2

D.I.C Regular
Group Icon

Joined: 5 Aug, 2008
Posts: 467



Thanked: 49 times
Dream Kudos: 75
My Contributions
That error is due to the permissions on the folders.

Right-click on the folder, and set the permissions to allow for file deletion.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 12:54PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month