471,337 Members | 998 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

ListDir/ListFiles of a dir recursively

Is there a fast way to read files/directory recursively?

Instead of inspecting each file(s)/dir(s), is there a way to know that its a
file or a directory from its hidden attribut both for windows or unix
filesystem? Thanks
Jul 17 '05 #1
4 2995
On Mon, 15 Mar 2004 16:57:00 -0500, "Ruby Tuesday" <ru*********@yahoo.com>
wrote:
Is there a fast way to read files/directory recursively?
I just posted one, see the recent 'findfile' thread.
Instead of inspecting each file(s)/dir(s), is there a way to know that its a
file or a directory from its hidden attribut both for windows or unix
filesystem? Thanks


What do you mean? What's a 'hidden attribute'? How can you check attributes of
a file or directory _without_ inspecting it?

To check if something is a directory, use is_dir().

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #2
Hi Andy, thanks for the script you send under "findfile" thead, and it work.

For a small directory(in term of number of files in it), it work great, but
then if there are many sub-directories and many files in each one of those
sub-directory, it starts to get very slow.

I know perhaps its a strech, but is there any other way to list files within
a directory and its sub-directories quicker.

If I'm not mistaken, in Unix, a directory is a file that contains a table
listing the files contained within it, giving file names to the inode
numbers in the list. An inode is a special file designed to be read by the
kernel to learn the information about each file. It specifies the
permissions on the file, ownership, date of creation and of last access and
change, and the physical location of the data blocks on the disk containing
the file

Is there similar method in Windows FileSystem by calling Windows System
Calls?

Thanks again.

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:aa********************************@4ax.com...
On Mon, 15 Mar 2004 16:57:00 -0500, "Ruby Tuesday" <ru*********@yahoo.com>
wrote:
Is there a fast way to read files/directory recursively?
I just posted one, see the recent 'findfile' thread.
Instead of inspecting each file(s)/dir(s), is there a way to know that its afile or a directory from its hidden attribut both for windows or unix
filesystem? Thanks


What do you mean? What's a 'hidden attribute'? How can you check

attributes of a file or directory _without_ inspecting it?

To check if something is a directory, use is_dir().

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

Jul 17 '05 #3
Tim Van Wassenhove wrote:
On 2004-03-16, Ruby Tuesdays <No**********************@yahoo.com> wrote:
For a small directory(in term of number of files in it), it work great, but
then if there are many sub-directories and many files in each one of those
sub-directory, it starts to get very slow.

I know perhaps its a strech, but is there any other way to list files within
a directory and its sub-directories quicker.

You could consider setting up some cache...


or write it in C as a PHP module.

Jul 17 '05 #4
On 2004-03-16, Ruby Tuesdays <No**********************@yahoo.com> wrote:
For a small directory(in term of number of files in it), it work great, but
then if there are many sub-directories and many files in each one of those
sub-directory, it starts to get very slow.

I know perhaps its a strech, but is there any other way to list files within
a directory and its sub-directories quicker.


You could consider setting up some cache...
--
http://home.mysth.be/~timvw
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Jason Kratz | last post: by
8 posts views Thread by Hannu Kankaanp?? | last post: by
reply views Thread by Ishwor | last post: by
7 posts views Thread by Kenneth Pronovici | last post: by
15 posts views Thread by Riccardo Galli | last post: by
1 post views Thread by kai | last post: by
3 posts views Thread by vedrandekovic | last post: by
1 post views Thread by Vladimir Rusinov | last post: by
reply views Thread by rosydwin | last post: by

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.