file name issue.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce Mac
    New Member
    • Mar 2007
    • 4

    #1

    file name issue.

    Hi guys.

    i was wondering, is there a way to open a stream to an unknown file or files.
    for eg. i normally use,

    ifstream in("some directory/only_this_file. txt");
    // do something to the input
    in.close();

    ofstream out ("another dirctory/only_that_file. txt");
    //write to file
    out.close();

    but say i wanted to do that to a whole directory of files of unknown names, are there wild characters that will let the program run through the whole directory and do the same operations on all the files?
    Ps. Not worried about the loop to run through a directory.

    thanks
    bruce
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    You can not do that using just the standard library. If you're willing to use, say,
    the GNU library there are a lot of options that allow you to do that. Have a look
    at your development environment and check out if something is implemented
    that allows you to manipulate/scan directories.

    kind regards,

    Jos

    Comment

    Working...