Opening Multiple files

This is a discussion on Opening Multiple files within the C Programming forums, part of the General Programming Boards category; i have a 100 data files which i need the program to open. the data files have names ranging from ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    1

    Opening Multiple files

    i have a 100 data files which i need the program to open. the data files have names ranging from say stress1000000.txt to stress1000099.txt. how do i open all these files simultaneously.

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Use an array of FILE objects.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    ...and don't forget to close all opened files.

  4. #4
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,109
    >>low limits on the number of files any single process can have open at the same time.

    In dos i thought it was about 7 . But to open 100 files ::i dont think that any OS lets one app open so many files.

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: Opening Multiple files

    Originally posted by Obroni
    i have a 100 data files which i need the program to open. the data files have names ranging from say stress1000000.txt to stress1000099.txt. how do i open all these files simultaneously.
    An example is in my first post in this thread
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening files sequentially
    By barneygumble742 in forum C++ Programming
    Replies: 9
    Last Post: 12-21-2006, 10:26 AM
  2. Opening Multiple Files in sequence
    By wujiajun in forum C++ Programming
    Replies: 7
    Last Post: 01-16-2006, 07:47 PM
  3. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM
  4. copy multiple files to a destination file
    By Bones in forum C++ Programming
    Replies: 2
    Last Post: 10-02-2003, 10:47 AM
  5. opening multiple files sequentially
    By moonwalker in forum C Programming
    Replies: 5
    Last Post: 08-20-2002, 09:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21