ListDir/ListFiles of a dir recursively

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ruby Tuesday

    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


  • Andy Hassall

    #2
    Re: ListDir/ListFiles of a dir recursively

    On Mon, 15 Mar 2004 16:57:00 -0500, "Ruby Tuesday" <rubytuzdayz@ya hoo.com>
    wrote:
    [color=blue]
    >Is there a fast way to read files/directory recursively?[/color]

    I just posted one, see the recent 'findfile' thread.
    [color=blue]
    >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[/color]

    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 <andy@andyh.co. uk> / Space: disk usage analysis tool
    <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

    Comment

    • Ruby Tuesdays

      #3
      Re: ListDir/ListFiles of a dir recursively

      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" <andy@andyh.co. uk> wrote in message
      news:aaac50p536 idr6vfo75rst1sa 52mqaicgh@4ax.c om...[color=blue]
      > On Mon, 15 Mar 2004 16:57:00 -0500, "Ruby Tuesday" <rubytuzdayz@ya hoo.com>
      > wrote:
      >[color=green]
      > >Is there a fast way to read files/directory recursively?[/color]
      >
      > I just posted one, see the recent 'findfile' thread.
      >[color=green]
      > >Instead of inspecting each file(s)/dir(s), is there a way to know that[/color][/color]
      its a[color=blue][color=green]
      > >file or a directory from its hidden attribut both for windows or unix
      > >filesystem? Thanks[/color]
      >
      > What do you mean? What's a 'hidden attribute'? How can you check[/color]
      attributes of[color=blue]
      > a file or directory _without_ inspecting it?
      >
      > To check if something is a directory, use is_dir().
      >
      > --
      > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      > <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>[/color]


      Comment

      • Terence

        #4
        Re: ListDir/ListFiles of a dir recursively

        Tim Van Wassenhove wrote:[color=blue]
        > On 2004-03-16, Ruby Tuesdays <NoSpamPlease_r ubytuzdaiz@yaho o.com> wrote:
        >[color=green]
        >>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.[/color]
        >
        >
        > You could consider setting up some cache...
        >
        >[/color]

        or write it in C as a PHP module.

        Comment

        • Tim Van Wassenhove

          #5
          Re: ListDir/ListFiles of a dir recursively

          On 2004-03-16, Ruby Tuesdays <NoSpamPlease_r ubytuzdaiz@yaho o.com> wrote:[color=blue]
          > 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.[/color]

          You could consider setting up some cache...


          --

          Comment

          Working...