Jump to content

How to delete a "readonly" file in Windows?


roddik

Recommended Posts

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

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:))

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.