The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

C++ file i/o woes by tzulah 2004-09-22 10:25:01
In spite of all the documentation I've read, this section of code will not do what I want:
ofstream outputFileStream;
outputFileStream.open(outputFileName, ios::binary|ios::out|ios::ate);
outputFileStream.close();
The file at outputFileName exists and has contents already. What this is SUPPOSED to do is open the file for writing anywhere I want (I should be able to use .seekp() to find my way around and modify bytes here and there). Once this is working, I will put my file modifications in between the .open and .close statements.

Instead, what actually happens is that it nukes outputFileName and creates a brand new empty file.

Does anybody have any idea what I'm doing wrong? :(

[ Reply ]
  ios::out is the problem by LongFist2004-09-22 10:29:31
    *pop* by tzulah2004-09-22 10:36:06
      false alarm... still not working by tzulah2004-09-22 10:46:46
        Can you give me a blurb? by LongFist2004-09-22 10:51:54
          sent. by tzulah2004-09-22 11:09:46
            Check mail, please... by LongFist2004-09-22 13:57:06

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)