Post new topic   Reply to topic
View previous topicPrintable versionPrivate messagesView next topic
Author Message
adminOffline
Post subject: Dateien mit 0kb/byte suchen und löschen  PostPosted: 13.05.2016 18:36
Admin
Admin


Joined: 01.04.2015 Posts: 27
Location: NRW Sassenberg
Status: Offline
Dateien mit 0kb/byte suchen und automatisch löschen...

      Code:
$fol = "/www/htdocs/test/";

if ($handle = opendir($fol)) {
    while (false !== ($entry = readdir($handle))) {
        if ($entry != "." && $entry != ".." && $entry != "removed.txt" && $entry != is_dir("".$fol."".$entry."")) {
         //Check filesize
         if(filesize("".$fol."".$entry."") < '1000'){
         $myfile = fopen("".$fol."removed.txt", "a") or die("Datei kann nicht geöffnet werden!");
            $txt = "$entry\r\n";
         fwrite($myfile, $txt);
         fclose($myfile);
         echo "".$entry."  - Entfernt <br>";
         unlink ("".$fol."".$entry."");
         }
        }
    }
    closedir($handle);
}
echo "Wenn keine Dateien die Dateien oben dann größer als 0kb aufgeführt sind";


Zum Downloaden
 
 View user's profile Send private message Visit poster's website Yahoo Messenger ICQ Number 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 11 Hours
Post new topic   Reply to topic
View previous topicPrintable versionPrivate messagesView next topic
 

 

Rotation Webcam

Archivbilder

 



Deine Position wird ermittelt...
 
Страница создана за 0.32 секунд.