Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

readfile(1f) [opensolaris man page]

readfile(1F)							   FMLI Commands						      readfile(1F)

NAME
readfile, longline - reads file, gets longest line SYNOPSIS
readfile filename longline [filename] DESCRIPTION
The readfile function reads filename and copies it to stdout. No translation of NEWLINE is done. It keeps track of the longest line it reads and if there is a subsequent call to longline, the length of that line, including the NEWLINE character, is returned. The longline function returns the length, including the NEWLINE character, of the longest line in filename. If filename is not specified, it uses the file named in the last call to readfile. EXAMPLES
Example 1 Typical use of readfile and longline Here is a typical use of readfile and longline in a text frame definition file: . . . text="`readfile myfile`" columns=`longline` . . . ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
cat(1), attributes(5) DIAGNOSTICS
If filename does not exist, readfile will return FALSE (that is, the expression will have an error return). longline returns 0 if a readfile has not previously been issued. NOTES
More than one descriptor can call readfile in the same frame definition file. In text frames, if one of those calls is made from the text descriptor, then a subsequent use of longline will always get the longest line of the file read by the readfile associated with the text descriptor, even if it was not the most recent use of readfile. SunOS 5.11 5 Jul 1990 readfile(1F)

Check Out this Related Man Page

tag(3tcl)                                                                                                                                tag(3tcl)

NAME
tag - Manipulate tagged files SYNOPSIS
tag option ?arg arg ...? DESCRIPTION
The tag procedure provides a number of options for manipulating tagged files. COMMANDS
tag readfile filename Reads the file with the given filename and returns a list where each list element is a tag record, which is represented by a list of label-value pairs, or label-value-endlabel triples. The tag header is the first element returned. tag writefile filename list Takes a list in the format used internally in tcl programs for tagged data and writes it as a tagged file. tag extract list tests Takes a list in tagged format, and a list of conditions, and returns a new list in tagged format which contains those tag records which match the conditions. The tests is a list of test items, each of which is a list of the form { labelname condition matchvalue } The conditions are == String equals != String not equal <= Less than or equal -in Is the test value a member of the list given as the matchvalue -contains Does the match value contain the test value as a case insensitive substring. -earlier Date earlier -later Date later - dates are in ISO format (yyyy-mm-dd [hh:mm:ss]). -exists Does the label exist in this record. BUGS
tag readfile reads the whole file into memory before turning it into a list. Should be more memory efficient. The -earlier and -later comparisons require TCL8.3 AUTHOR
John Lines (john@paladin.demon.co.uk) July 3, 2000 tag(3tcl)
Man Page