strange problem with unlinl

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

strange problem with unlinl

Post 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
Post Reply