roddik Posted March 15, 2007 Share Posted March 15, 2007 Hi, guys! Got the following problem: PHP has no problem with deleting an ordinary file, but when it is marked as "Read-Only", I get such an error: Warning: unlink(Z:/home/localhost/www/***.html) [function.unlink]: Permission denied in z:\home\localhost\www\roddik\test.php on line 45. Thanks for any suggestions! Link to comment https://forums.phpfreaks.com/topic/42829-how-to-delete-a-readonly-file-in-windows/ Share on other sites More sharing options...
Gruzin Posted March 15, 2007 Share Posted March 15, 2007 try to set file or folder permission to 777 edit: if it's on your local pc then make sure that file exists Link to comment https://forums.phpfreaks.com/topic/42829-how-to-delete-a-readonly-file-in-windows/#findComment-207896 Share on other sites More sharing options...
roddik Posted March 15, 2007 Author Share Posted March 15, 2007 Already tried. Used the following foreach($o as $file) { chmod('Z:/home/localhost/www/***/'.$file,777); unlink('Z:/home/localhost/www/***/'.$file); } No result:( file exists, I use a get every filename in a certain directory and then delete each separately (hm.... try to delete:)) Link to comment https://forums.phpfreaks.com/topic/42829-how-to-delete-a-readonly-file-in-windows/#findComment-207898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.