|
Try adding O_append to the 2nd open.
Yours truly,
Glenn Gundermannglenn.gundermann@xxxxxxxxx (416) 317-3144
-------- Original message --------From: Jack Tucky <jacktucky@xxxxxxxxx>
Date: 2016-04-26 8:17 PM (GMT-05:00) To: "RPG programming on the IBM i
(AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx> Subject: IFS Open & Append
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?
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
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.