06-29-2012 11:23 AM
Hello All
I have a CVI program that uses two ASCII Text files to hold progress info
as my program iterates. Each iteration, I want to overwrite each file with
new data.
My problem is that I have hundreds of iterations, and as the file handle numbers
increment I hit a value of 128 and my generates a file I/O error.
Seeing that I'm always writing to the exact same two files in the exact same
path, is there a way that I can hard code their file handle numbers to suppress
the handle number increment that occurs each time I call my write to file prototype?
07-02-2012 03:56 AM
From what you say, it seems that your program works on 2 files only at each iteration; in the next iteration you do not need to access previous data. If this is true, you should not have progressive increment of the file handles and you should not have I/O errors provided you close the files when you have terminated using them.
I suggest you check in your code and add the necessary closing function.
07-02-2012 08:22 AM
Hi Roberto
Yes, I did a dive into my code this weekend and found that if i just opened my files prior
to entering the structure, then closed them on exit, no problems. My mistake was assuming
that a file handle -once assigned and associated with a literal path to a file - would remain
static through each open/close. My bad.
Anyway, thank you for the response.