Page 1 of 1

strange problem with unlinl

Posted: Sun Dec 12, 2004 9:51 am
by pelegk2
i have this code :

Code: Select all

foreach (glob("\\\\uniavkot1\\UniB\\*.txt") as $filename) {
   copy("X:/".basename($filename), "X:/backup/".basename($filename));
   unlink   ("k:&quote;.basename($filename)); ///(*1)

  } //foreach
  echo unlink("k:\\0445110_01.txt")  ; ///(*2)
?>
the problen is that when i do unlink wih line (*1) i always get the message :
Warning: unlink(k:\0445110_01.txt): Permission denied in C:\Program Files\Apache Group\Apache2\htdocs\uniprod\readFiles.php on line 46
but with line : (*2) i never have this problem!!! (in line 2 i hardcoded one of the files i wish to delete and it worked fine! i even put it in the loop and still it works fine
so what to do?
why can this happen?
thnaks in advance
peleg