Rogue files on server...
| From: | jalist | Date: | Sat, 25 Nov 2000 15:52:00 +0000 |
| Subject: | Rogue files on server... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27119@lists.php.net to get a copy of this message | ||
Hi
I've written a script that parses a large text file and saves the pieces I
need as seperate small chunks. I can read and display the new files, but I
can't delete/rename them from my ftp, either manually or by using unlink(),
I get a 'file doesn't exist' error, even though opendir() lists the files as
existing. Could this be a php, ftp or server problem? Any ideas, my webspace
is full with 2kb files I can't do anything with, heh.
Apologies if this is considered OT.
Thanks in advance. And excuse my code, haven't been doing this for long.
Steve
jalist@jalist.com
http://ls2k.org
---CODE---
$cache = "cache/news.cache";
$count = 0;
$dir = "news";
$handle=opendir($dir);
while ($file = readdir($handle)){
if ($file != "." && $file != "..")
$news_files[count($news_files)] = $file;
$count++;
}
}
closedir($handle);
$fpread = fopen($cache, 'r');
$file_size = filesize($cache);
$tx = fread($fpread, $file_size);
fclose($fpread);
$info = explode("\n", $tx);
for($c=0; $c <=$count; $c++){
// blah blah blah - snipped parse routine ----->
$savetext =
"$heading\n$text\n$tida\n$source\n$sourceurl\n$sourcename\n$poster\n";
$savefile = "news/$newtag";
$fpwrite = fopen($savefile, 'w');
fputs($fpwrite, $savetext);
fclose($fpwrite);
echo "File $newtag saved...<br>";
}
---CODE END---