I'm trying to open a stream file to append data to it. This is the code I
grabbed from the internet to test:
fd = open(%trim($file_name)
: O_WRONLY+O_CREAT+O_APPEND+O_CCSID
: S_IRGRP + S_IWGRP + S_IXGRP:819);
callp close(fd);
fd = open(%trim($file_Name):O_WRONLY+O_TEXTDATA);
$xml = '<Items>';
callp write(fd: %addr($xml): %len(%trim($xml)));
when I write to the stream file it goes to the beginning of the file.
I tried reading through the file using this first, then using write but it
did the same thing
dow (read(fd: %addr(Buf): %size(Buf)) > 0);
buf = *allx'20';
enddo;
How can I add to the end of a stream file?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.