simmsdk
Posts: 6
|
| Posted: 09/23/2004, 9:57 AM |
|
I have a page with a label called show_dir, and in before show of this label i have this code
global $show_dir;
$dir = "/go/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
$show = $file."<br>";
$show_dir->SetValue($show);
}
closedir($dh);
}
}
But it shows nothing !!!!
yes, the dir exist and yes there is dirs and files in it...
Anyone with a better debug eye than me is very welcome... cos im blinded right now.
|
 |
 |
martin
|
| Posted: 09/23/2004, 11:09 AM |
|
Hello.
This works fine for me.
If the new Zip File ($NewZipAll) with all Files from the dir $ZipDataPfad
is provided I can delete all files in the dir $ZipDataPfad.
###############################################
$ZipDataPfad = "./12345";
$NewZipName = 12345.zip";
$NewZipAll = $NewZipName;
// delete old Zip
if(file_exists($NewZipAll)){
unlink($NewZipAll);}
// new Zip with all files from the dir
$output = shell_exec("zip -r $NewZipAll . -i $ZipDataPfad/\*");
// old files delete
###############################################
if(file_exists($NewZipAll)){
$inputdir = opendir ($ZipDataPfad);
$pattern = ".|..";
while ($datei = readdir ($inputdir))
{
if (!ereg($datei,$pattern)) {
if (preg_match("/^index/", $datei)) continue;
if (preg_match("/\.\.?$/", $datei)) continue;
$name = explode(".",$datei);
// Data determine
$dest = $ZipDataPfad . "/" .$datei;
// Delete old files
if (file_exists($dest)){
unlink($dest);
}
}
}
closedir ($inputdir);
}
Sorry about my english and perhaps it helps.
By martin
|
|
|
 |
|