Linux Folder Iteration

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

    #1

    Linux Folder Iteration

    Hi,

    Sorry if this is OT but I'm not sure where else to post it.

    How do you iterate through the files in a particular folder on linux in
    C++?

    Thanks,
    Connell

  • Schüle Daniel

    #2
    Re: Linux Folder Iteration

    Connell wrote:[color=blue]
    > Hi,
    >
    > Sorry if this is OT but I'm not sure where else to post it.
    >
    > How do you iterate through the files in a particular folder on linux in
    > C++?
    >
    > Thanks,
    > Connell
    >[/color]

    look for opendir, readdir in google or
    man opendir

    hth, Daniel

    Comment

    • red floyd

      #3
      Re: Linux Folder Iteration

      > Connell wrote:[color=blue]
      >[color=green]
      >> Hi,
      >>
      >> Sorry if this is OT but I'm not sure where else to post it.
      >>
      >> How do you iterate through the files in a particular folder on linux in
      >> C++?
      >>[/color][/color]

      [OFF-TOPIC]
      [PEDANTIC]
      Linux has "directorie s", not "folders".
      [/PEDANTIC]
      [/OFF-TOPIC]

      Comment

      • Dietmar Kuehl

        #4
        Re: Linux Folder Iteration

        Connell wrote:[color=blue]
        > Sorry if this is OT but I'm not sure where else to post it.[/color]

        Well, as is, the question is clearly off-topic because it is
        environment specific. There is, however, a fairly general answer:
        [color=blue]
        > How do you iterate through the files in a particular folder on linux in
        > C++?[/color]

        The Boost file system library provides functionality like this. As
        this library will likely become part of the second C++ library
        technical report (TR2 for short), it has a fair chance to eventually
        become part of the standard C++ library. Just get the library from
        <http://www.boost.org/>.
        --
        <mailto:dietmar _kuehl@yahoo.co m> <http://www.dietmar-kuehl.de/>
        <http://www.eai-systems.com> - Efficient Artificial Intelligence

        Comment

        Working...