CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Problem with readdir in Before Show on label.

Print topic Send  topic

Author Message
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.
View profile  Send private message
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

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.