473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to automatically extract all rar files recursively from a top directory in gmail

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. function scanDirectories($rootDir, $allowext, $allData=array()){
  3.     $dirContent = scandir($rootDir);
  4.     foreach($dirContent as $key => $content){
  5.         $path = $rootDir.'/'.$content;
  6.      $ext = substr($content, strrpos($content, '') + 1);
  7.       if(in_array($ext, $allowext)) {
  8.             if(is_file($path) && is_readable($path)){
  9.                 $allData[] = $path;}
  10.             elseif(is_dir($path) && is_readable($path)) {
  11.                 // recursive callback to open new    directory
  12.           $allData = scanDirectories($path, $allData);
  13.             }    } }
  14.     return $allData;}
  15. $rootDir = "www";
  16. $allowext = array("zip","rar","html");
  17. $files_array = scanDirectories($rootDir,$allowext);
  18. print_r($files_array);
  19. ?>
...ERROR IS:
Warning: scandir(www,www) [function.scandir]: The system cannot find the file specified. (code: 2) in C:\Zend\Apache2\htdocs\CSV\example.php on line 4

Warning: scandir(www) [function.scandir]: failed to open dir: No such file or directory in C:\Zend\Apache2\htdocs\CSV\example.php on line 4

Warning: scandir() [function.scandir]: (errno 2): No such file or directory in C:\Zend\Apache2\htdocs\CSV\example.php on line 4

Warning: Invalid argument supplied for foreach() in C:\Zend\Apache2\htdocs\CSV\example.php on line 5
Array ( )





please help ......:'(
Jan 13 '13 #1
0 1577

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jeff | last post by:
Could someone help me out with automatically overwriting files when using a MS Project VB macro? As you can see, I have the file saving to native format, then to a HTML file. When it goes to save...
3
by: Raseliarison nirinA | last post by:
hi all, i found an unanswered question at http://www.faqts.com/knowledge_base/index.phtml/fid/538 with possible response below. i've tried to send it at faqt.python but can't figure out how to...
0
by: David Isaac | last post by:
I'm looking for Python code to extract files from MS-TNEF attachments. (I'm aware of the C code at http://tnef.sourceforge.net/ ) Thanks, Alan Isaac
2
by: Jean-Paul Lauque | last post by:
Hello, I'm beginning in the ASP world... I would like to sort (descending) list of files in directory. Parameter is directory url. How I can to do that with ASP not ASP.NET.
3
by: ReidarT | last post by:
I want to copy files in directory to another location like c:\dir1\*.* to f:\dir2 Do I need to copy file by file or can I just copy the whole directory regards reidarT
2
by: Newbie | last post by:
Hi All Is it possible to extract files and folders from a zip archive using ASP? If not classic, will .net do it as a standard task, ie no activex dlls, etc? Thanks
2
by: Zytan | last post by:
You can download them here: http://msdn2.microsoft.com/en-us/vstudio/aa718338.aspx This snippet seems wrong: Visual C# 2005 Code Snippets -filesystem -Search a Directory for Files Recursively ...
3
by: =?Utf-8?B?UHVyZSBIZWFydA==?= | last post by:
hi i need the code to move files from directory to another directory on sam local machine or to a network path, thank you. -- Ammar S. Mitoori IT Head QIMCO Co. Tel : +9744831199 Mobile :...
3
by: froditus | last post by:
Hello everyone, is it possible to list files from directory other than in apache web directory? my web folder is placed on c:/ and i put my files in windows directory "d:/files/images/". I...
3
by: sijugeo | last post by:
Which is the namespace which can be used to get the user files and directory details. Regards, Siju George
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.