I don't know how to preserve both the CR and LF, but from Wikipedia it appears your last line should have at least LF.
HTH

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of MichaelQuigley@xxxxxxxxxx
Sent: Tuesday, June 02, 2015 8:12 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Line-ending for IFS test stream file

Hi folks,

I've got a program which opens, reads, scans the data modifying some of the content, then writes and truncates a file in the IFS. It uses the open, write, ftruncate, and close APIs. The open uses the o_TextData flag so the CCSIDs are automatically converted for my program to manipulate the data on the IBM i. Everything works great with the exception that the line ending carriage-return and line feed (CRLF) is being changed. When I debug the program and step through file scanning, the CRLF is being processed correctly--i.e., I see the two bytes processed at the end of each line.
But when the file is re-written and closed, the CRLF is modified to simply be a carriage-return.

This isn't a problem most of the time, but there are cases where the PC program which later uses the processed data isn't recognizing the last line of data since it doesn't end with CRLF. Is there an option I've overlooked or something I can do to preserve the CRLF?

Thanks,
Michael Quigley
Computer Services
The Way International
www.TheWay.org
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.