Scanning All Files And Directories

  • Uploaded by: Yunior Rahmawan Usop
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Scanning All Files And Directories as PDF for free.

More details

  • Words: 257
  • Pages: 2
Scanning All Files and Directories 02-11-2008 | 23:51:38 | Halaman Ini dibaca 1554 kali

Anda dapat membuat Fungsi scanning dalam PHP. Scanning berikut menghasilkan query dalam bentuk array, dan bersifat continue sampe file terakhir pada folder terakhir, jadi smua bakalan discan, kecuali untuk nilai pada variable $invisibleFileNames yang ditampung juga dalam array $content) { // filter all files not accessible $path = $rootDir.'/'.$content; if(!in_array($content, $invisibleFileNames)) { // if content is file & readable, add to array if(is_file($path) && is_readable($path)) { $tmpPathArray = explode("/",$path); // saving filename $allData[$fileCounter]['fileName'] = end($tmpPathArray); // saving while path (for better access) $allData[$fileCounter]['filePath'] = $path; // get file extension $filePartsTmp = explode(".", end($tmpPathArray)); $allData[$fileCounter]['fileExt'] = end($filePartsTmp); // get file date $allData[$fileCounter]['fileDate'] = date('Y-m-d H:i:s', filectime($path)); // get filesize in byte $allData[$fileCounter]['fileSize'] = filesize($path); //query SQL dapat diletakkan disini: //mysql_query("INSERT INTO dirGue(path, filename) VALUES('".$allData[$fileCounter]['filePath']."', '".$allData[$fileCounter]['fileName']."')")

$fileCounter++; // if content is a directory and readable, add path and name }elseif(is_dir($path) && is_readable($path)) { $dirNameArray = explode('/',$path); $allData[$path]['dirPath'] = $path; $allData[$path]['dirName'] = end($dirNameArray); // recursive callback to open new directory $allData[$path]['content'] = scanDirectories($path); } } } return $allData; } if(isset($_POST['submit']) && !empty($_POST['rootDir'])) { print_r(scanDirectories($_POST['rootDir'])); } ?>

Scanning All Files and Directories

Selamat mencoba :D~~

Related Documents

All Files
October 2019 6
Active Directories
June 2020 11
Directories Evaluation
June 2020 13
Active Directories.
November 2019 16

More Documents from ""

Rootsshattck
December 2019 34
Tips En Trick
December 2019 35
Mereset Password Linux
December 2019 35
Di Anggap Spam Sama Akismet
December 2019 37
Membuat Linux Live Cd
December 2019 35