[cc65] CBM POSIX I/O w/o O_TRUNC ?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2010-02-05 13:33:19
Hi,

I want to change just the first few bytes of a longer file. From the
POSIX docs (and my experience in other environments) learned that I
can do so simply by omitting O_TRUNC (and O_CREAT) like this:

int f = open("myfile", O_WRONLY);
write(f, mybuffer, mysize);
close(f);

From what I've heard so far the CBM sequential files have some
limitations. Therefore I'd like to know if I can presume the code
above to behave as decribed.

You may ask: Why isn't he just trying? I've learned that the CBM DOS
livs in the drives so I could i.e. imagine the code above working on
one drive, but not the other - or any other isse that I don't
recognize in a simple test.

So thanks in advance for your help, Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri, 5 Feb 2010 13:33:19 +0100

This archive was generated by hypermail 2.1.8 : 2010-02-05 13:33:28 CET