Get all files list in a directory

Discussion in 'C++' started by yaron, Oct 4, 2003.

  1. yaron

    yaron Guest

    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
    yaron, Oct 4, 2003
    #1
    1. Advertising

  2. yaron

    Mike Wahler Guest

    Mike Wahler, Oct 4, 2003
    #2
    1. Advertising

  3. yaron wrote:

    > 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.


    That's because it's not standard. There is no standard support for
    dealing with directories.

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


    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
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
    Kevin Goodsell, Oct 4, 2003
    #3
  4. yaron

    WW Guest

    yaron wrote:
    > 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.


    http://www.boost.org/libs/filesystem/doc/index.htm

    --
    WW aka Attila
    WW, Oct 4, 2003
    #4
  5. yaron

    yaron Guest

    Kevin Goodsell <> wrote in message news:<2cGfb.2068$>...
    > yaron wrote:
    >
    > > 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.

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

    >
    > 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



    Thanks my friend
    yaron, Oct 5, 2003
    #5
  6. yaron

    yaron Guest

    "WW" <> wrote in message news:<blnb3d$hsl$>...
    > yaron wrote:
    > > 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.

    >
    > http://www.boost.org/libs/filesystem/doc/index.htm


    Thanks, my friend
    yaron, Oct 5, 2003
    #6
  7. yaron

    Ashish Guest

    "yaron" <> wrote in message
    news:...
    > 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


    Ask in a unix/linux newsgroup. They'll be able to help you
    Ashish, Oct 6, 2003
    #7
  8. yaron

    Avinash Guest

    "Ashish" <> wrote in message news:<blsoe4$fltq8$-berlin.de>...
    > "yaron" <> wrote in message
    > news:...
    > > 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

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


    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.
    Avinash, Oct 7, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page