|
----- Message from Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> on
Wed, 03 Jun 2015 10:16:13 -0500 -----
To:
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject:
Re: Line-ending for IFS test stream file
Michael,
Can you explain what you're using ftruncate() for? This was the only
part of your message I didn't understand. Just using it to clear the
file (instead of O_TRUNC?)
The open/write/close APIs will not change your CRLF. If you are writing
two characters (both CR and LF) then it may translate this to ASCII or
something, but it won't ever remove one of them. (You may be thinking
of the ANSI C fopen() API with the crln setting? But as that's not
being used here, it can't come into play. The Unix open() API does not
do this.)
My guess is that you are viewing the file in a Unix text editor. For
that reason, you're seeing the carriage return on the screen (since Unix
never expects a carriage return) but you're not seeing the LF because
it's expected and is just treated as a line break. Could that be it?
(That you are just confused by the way it looks on your screen, and both
characters are there?)
Otherwise, please post your code -- I've been using these APIs for
decades (and on Unix systems before that) and have never heard of them
changing CRLF to just CR...
-SK
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.