Get all files list in a directory

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

    Get all files list in a directory

    Hi all

    I am trying to find how to open a directory and getting the list of
    files which belong to it. In the past I did the same thing with
    "opendir", but I used UNIX and in the windows platform I can not use
    the same command.

    I am looking for a solution for almost a week. Please, please, please
    help.

    Thanks
    Yaron
  • Mike Wahler

    #2
    Re: Get all files list in a directory


    "yaron" <c_yaron@hotmai l.com> wrote in message
    news:6404b44.03 10041226.205d5a 4d@posting.goog le.com...[color=blue]
    > Hi all
    >
    > I am trying to find how to open a directory and getting the list of
    > files which belong to it. In the past I did the same thing with
    > "opendir", but I used UNIX and in the windows platform I can not use
    > the same command.
    >
    > I am looking for a solution for almost a week. Please, please, please
    > help.[/color]


    http://www.parashift.com/c++-faq-lit...es.html#faq-39.
    5

    -Mike

    [color=blue]
    >
    > Thanks
    > Yaron[/color]


    Comment

    • Kevin Goodsell

      #3
      Re: Get all files list in a directory

      yaron wrote:
      [color=blue]
      > Hi all
      >
      > I am trying to find how to open a directory and getting the list of
      > files which belong to it. In the past I did the same thing with
      > "opendir", but I used UNIX and in the windows platform I can not use
      > the same command.[/color]

      That's because it's not standard. There is no standard support for
      dealing with directories.
      [color=blue]
      >
      > I am looking for a solution for almost a week. Please, please, please
      > help.[/color]

      Try a group that supports the OS you are targeting or the implementation
      you are using. You could also check for availably libraries. The Boost
      library has support for this, I think. You could also look for the
      Available C++ Libraries FAQ which is posted here from time to time.

      See:


      That link contains, among other things, a list of groups where you might
      be able to find specific help.

      -Kevin
      --
      My email address is valid, but changes periodically.
      To contact me please use the address from a recent posting.

      Comment

      • WW

        #4
        Re: Get all files list in a directory

        yaron wrote:[color=blue]
        > Hi all
        >
        > I am trying to find how to open a directory and getting the list of
        > files which belong to it. In the past I did the same thing with
        > "opendir", but I used UNIX and in the windows platform I can not use
        > the same command.[/color]



        --
        WW aka Attila


        Comment

        • yaron

          #5
          Re: Get all files list in a directory

          Kevin Goodsell <usenet1.spamfr ee.fusion@never box.com> wrote in message news:<2cGfb.206 8$gA1.427@newsr ead3.news.pas.e arthlink.net>.. .[color=blue]
          > yaron wrote:
          >[color=green]
          > > Hi all
          > >
          > > I am trying to find how to open a directory and getting the list of
          > > files which belong to it. In the past I did the same thing with
          > > "opendir", but I used UNIX and in the windows platform I can not use
          > > the same command.[/color]
          >
          > That's because it's not standard. There is no standard support for
          > dealing with directories.
          >[color=green]
          > >
          > > I am looking for a solution for almost a week. Please, please, please
          > > help.[/color]
          >
          > Try a group that supports the OS you are targeting or the implementation
          > you are using. You could also check for availably libraries. The Boost
          > library has support for this, I think. You could also look for the
          > Available C++ Libraries FAQ which is posted here from time to time.
          >
          > See:
          > http://www.slack.net/~shiva/welcome.txt
          >
          > That link contains, among other things, a list of groups where you might
          > be able to find specific help.
          >
          > -Kevin[/color]


          Thanks my friend

          Comment

          • yaron

            #6
            Re: Get all files list in a directory

            "WW" <wolof@freemail .hu> wrote in message news:<blnb3d$hs l$1@phys-news1.kolumbus. fi>...[color=blue]
            > yaron wrote:[color=green]
            > > Hi all
            > >
            > > I am trying to find how to open a directory and getting the list of
            > > files which belong to it. In the past I did the same thing with
            > > "opendir", but I used UNIX and in the windows platform I can not use
            > > the same command.[/color]
            >
            > http://www.boost.org/libs/filesystem/doc/index.htm[/color]

            Thanks, my friend

            Comment

            • Ashish

              #7
              Re: Get all files list in a directory


              "yaron" <c_yaron@hotmai l.com> wrote in message
              news:6404b44.03 10041226.205d5a 4d@posting.goog le.com...[color=blue]
              > Hi all
              >
              > I am trying to find how to open a directory and getting the list of
              > files which belong to it. In the past I did the same thing with
              > "opendir", but I used UNIX and in the windows platform I can not use
              > the same command.
              >
              > I am looking for a solution for almost a week. Please, please, please
              > help.
              >
              > Thanks
              > Yaron[/color]

              Ask in a unix/linux newsgroup. They'll be able to help you


              Comment

              • Avinash

                #8
                Re: Get all files list in a directory

                "Ashish" <ashoooo@hotmai l.com> wrote in message news:<blsoe4$fl tq8$1@ID-75446.news.uni-berlin.de>...[color=blue]
                > "yaron" <c_yaron@hotmai l.com> wrote in message
                > news:6404b44.03 10041226.205d5a 4d@posting.goog le.com...[color=green]
                > > Hi all
                > >
                > > I am trying to find how to open a directory and getting the list of
                > > files which belong to it. In the past I did the same thing with
                > > "opendir", but I used UNIX and in the windows platform I can not use
                > > the same command.
                > >
                > > I am looking for a solution for almost a week. Please, please, please
                > > help.
                > >
                > > Thanks
                > > Yaron[/color]
                >
                > Ask in a unix/linux newsgroup. They'll be able to help you[/color]

                try to use the following code

                system ( " dir /b pDirName > temp.txt " );
                do this in C, this will store all the names of the directory pDirName
                in temp.txt and then read this file and store it in the list.

                Comment

                Working...