I'm having a problem with the ofstream aspect of a c++ program. I have a rather large text file (1.9GB...ouch) that I'm trying to open with my program, do stuff, and send the results to a new text file.
I've tested the program with smaller text files, and it works fine. But when I go to use the giant text file, it seems to actually delete most of the ofstream text file, and doesn't create a new text file at all. As the program runs, the size of the file drops immediately from 1.9GB to 4K.
Since this doesn't happen when I run the program on a small text file, I assume there is some sort of problem with ofstreaming such a large file. Is this true? and if so, how can I get around this?
If it makes a difference, the computer I'm using for this program is an Intel MacPro, with 4GB of ram. (not mine, but I was given access to it for this project)
Oh, I think I did something dumb. ofstream is the OUTPUT file and ifstream is the INPUT file. So you put the big file as the ofstream filename, then it gets replaced with the non-existent other file...
I'm just glad that I realized it myself...I feel slightly less dumb than I would if I had remained dumbfounded for an hour, and then finally had someone else tell me. :-)