1readfile(1F) FMLI Commands readfile(1F)
2
3
4
6 readfile, longline - reads file, gets longest line
7
9 readfile filename
10
11
12 longline [filename]
13
14
16 The readfile function reads filename and copies it to stdout. No trans‐
17 lation of NEWLINE is done. It keeps track of the longest line it reads
18 and if there is a subsequent call to longline, the length of that line,
19 including the NEWLINE character, is returned.
20
21
22 The longline function returns the length, including the NEWLINE charac‐
23 ter, of the longest line in filename. If filename is not specified, it
24 uses the file named in the last call to readfile.
25
27 Example 1 Typical use of readfile and longline
28
29
30 Here is a typical use of readfile and longline in a text frame defini‐
31 tion file:
32
33
34 .
35 .
36 .
37 text="`readfile myfile`"
38 columns=`longline`
39 .
40 .
41 .
42
43
44
46 See attributes(5) for descriptions of the following attributes:
47
48
49
50
51 ┌─────────────────────────────┬─────────────────────────────┐
52 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
53 ├─────────────────────────────┼─────────────────────────────┤
54 │Availability │SUNWcsu │
55 └─────────────────────────────┴─────────────────────────────┘
56
58 cat(1), attributes(5)
59
61 If filename does not exist, readfile will return FALSE (that is, the
62 expression will have an error return).
63
64
65 longline returns 0 if a readfile has not previously been issued.
66
68 More than one descriptor can call readfile in the same frame definition
69 file. In text frames, if one of those calls is made from the text
70 descriptor, then a subsequent use of longline will always get the long‐
71 est line of the file read by the readfile associated with the text
72 descriptor, even if it was not the most recent use of readfile.
73
74
75
76SunOS 5.11 5 Jul 1990 readfile(1F)