How to list a directory? 
Author Message
 How to list a directory?

How to list a directory?


Thu, 02 Sep 2004 07:42:35 GMT  
 How to list a directory?

Quote:

> How to list a directory?

perldoc -f readdir

--
To get something done, a committee should consist of no more than three
persons, two of them absent.



Thu, 02 Sep 2004 08:20:52 GMT  
 How to list a directory?
if you mean by that question "how to list contents of directory" then I
suggest you following:


closedir(SOMEDIR);

        dosomethingwithfiles;
    }

remember, you will have also "." and ".." in that array, which are
definitely not files and probably you will not be able to do anything with
them ;))

path...

jk


Quote:
> How to list a directory?



Sat, 04 Sep 2004 19:47:15 GMT  
 How to list a directory?
Do a:

open(FILES, "/usr/bin/find . -type f -follow -print |") or die "open
for find: $!";

Then read FILES like:

while(defined($file = <FILES>)){
        #any code

Quote:
}

Read the find man on how to use more options...
Quote:

> How to list a directory?



Sat, 04 Sep 2004 22:08:04 GMT  
 How to list a directory?
Oh, yes. Don't forget to chop the file names in $file. You will get
"No such file or directory" otherwise.

Daniel

Quote:

> Do a:

> open(FILES, "/usr/bin/find . -type f -follow -print |") or die "open
> for find: $!";

> Then read FILES like:

> while(defined($file = <FILES>)){
>         #any code
> }

> Read the find man on how to use more options...


> > How to list a directory?



Sat, 04 Sep 2004 22:49:10 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. perl script to list only directories

2. Help: perl script to list only directories

3. Getting listing of directories as texts

4. getting list of directories, returned as an array

5. how can i list a directory into a browser??

6. Help with directory listing: filenames or directories

7. Directory listing query with Net::FTP::list

8. Directory listing query with Net::FTP::list

9. Active Directory: Listing users in a group

10. Script wanted to return a hypertext list of a directory's contents

11. Obtaining list of all files and subdirectories in a directory

12. Assigning Directory Contents to a Unique List

 

 
Powered by phpBB® Forum Software