FTAM/9000 Programmer's Guide
64 Chapter 2
Using HP FTAM/9000
General Recommendations
Handling Strings, HP-UX Lines, and FTAM-1
Lines
NOTE This section applies to FTAM-1 files only and to strings as they are used
within low level FTAM calls.
This section clarifies the meaning of a string, HP-UX line, and FTAM-1
line. When transferring data with low level calls, you must understand
FTAM-1 lines. If you are reading or writing local HP-UX files using low
level calls, you must understand how to convert between HP-UX lines
and FTAM lines.
Since HP-UX uses %<LF> to represent new lines, you must convert each
%<LF> to the combination %<CR,LF> when writing to FTAM-1 files. For
example, if your application reads an HP-UX file and subsequently sends
the data as an FTAM-1 file (using low level FTAM calls), you must
convert all instances of %<LF> in the data to %<CR,LF> before sending
it.
• Any FTAM data element you receive uses %<CR,LF> to indicate a
new line. Consequently, to write such data to an HP-UX file without
using FTAM, you must write a %<LF> for every %<CR,LF>
combination.
• Any FTAM data element you send must use %<CR,LF> to indicate a
new line. A single %<LF> character is treated as data.
If you did not receive data directly from an FTAM function call and if you
are using FTAM low level calls (e.g., ft_sdata()), you must insert
%<CR,LF> characters to delimit lines; you will receive them back in
ft_rdata() output.
String A string is data within or pointed to by the primitive
field of type struct Ft_data_element. A string may
contain multiple or partial FTAM lines.
HP-UX Line HP-UX lines are terminated by LINE FEED %<LF>
characters (%<LF> is ‘\n’ or ‘\012’).
FTAM-1 Line FTAM-1 lines are terminated by a combination of
CARRIAGE-RETURN/LINE-FEED %<CR,LF>
(‘%<CR> is \r’ or ‘\015’).