Solved it by myself. :)
unlink($file); needs to be *exact* address to the file to be unlinked like
"/www/dir/map/$file".
Just in case if someone else meets this problem!
Niklas
-----Original Message-----
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: 23. elokuuta 2001 15:17
To: Php-General
Subject: [PHP] Removing files from a directory
I'm trying to remove files from a directory. I have this code to do it:
This code is in a included file located at '/map/'. File including this code
is located at '/'. Files to be removed are located at '/map/'.
$Handle = opendir('map/');
while ($file = readdir($Handle)) {
if (substr($file, 0, 3) == "md_") {
$split = explode("_", $file);
if ((time() - $split[1]) > 300) {
unlink($file);
};
};
};
What this does is return a Internal Server Error! If add do
unlink("map/".$file); it returns file not found. What to do? What is wrong?
Niklas Lampén
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]