Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Opening multiple files

  • 22-01-2004 11:01pm
    #1
    Closed Accounts Posts: 18


    Hi,

    I have a folder that contains a number of files with the same extension eg, *.txt. I want my program to open all these files.

    The program doesn't know the file names. I want the program to enter a loop and read in each file that has a specific extension.

    Is it possible to do this? I am using MS VC++ 6. Would suit best if it could be done using fopen and fread.


    Thanks in advance


Comments

  • Registered Users, Registered Users 2 Posts: 2,152 ✭✭✭dazberry


    You need to iterate thru' the directory first to get all the matching files. Look up FindFirstFile and related calls in the WinAPI help or MSDN. Once you have the filenames you can open them with whatever method you choose.

    D.


Advertisement