Re: unlink ($files);

From: Date: Wed, 08 Jan 2003 14:24:09 +0000
Subject: Re: unlink ($files);
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130768@lists.php.net to get a copy of this message
Can't do wildcards like * because thats something that as I found out a few days ago, is expanded by the shell into a full command, so because your not running a shell, it can't be expanded and the raw unlink call to *.* fails because the unlink function doesn't understand wildcards. If you really want to do a recursive deletion (i.e., remove both a directory and everything under it) you could use: exec("/bin/rm -rf path/$name-of-dir-to-be-erased"); Just be very sure about what your doing (multiple checks on the variable's value to make sure your not erasing anything you don't want to) cause this command, when executed with the proper permissions, will kill any directory and everything under it. On Wed, 2003-01-08 at 00:29, rw@xend.net wrote: Ok, Jason, here's another one! I think I've read how to delete a file. I need to delete 25 files, then do a rmdir(blah); Line 16: $directory = "path/*.*"; Warning: Unlink failed (No such file or directory) in /mnt/ls6/17/169/00000000/htdocs/2003/_admin/del_listing_action.php on line 16 Warning: RmDir failed (File exists) in /mnt/ls6/17/169/00000000/htdocs/2003/_admin/del_listing_action.php on line 17 Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt (adam@cryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
« previous php.general (#130768) next »