ftos(1A) — MISC REFERENCE MANUAL PAGES
NAME
ftos, stof − file to stream, stream to file
SYNOPSIS
ftos [ −vB ]
stof [ −tvF ] [ −d dir ] [ −f file ]
DESCRIPTION
These utilities transfer file data between a directory hierarchy and a byte stream. The stream can be saved in a file, on tape, or can be piped. Saved in the stream are various file attributes: owner, permissions, modification time, and links to other files. Directories leading to the file are also saved. Device files, named pipes and symbolic links are recognized.
ftos reads file names from its standard input, one per line, and writes file data to standard output. The −v option requests verbose processing. The −B option requests that output be a multiple of a block (usually 1024).
stof reads file data from its standard input. If the −t option is given then files are merely listed by name, otherwise the files will be extracted. The −v option requests verbose processing; when combined with −t, file attributes are listed. The −d option constrains file extraction to a particular directory, which is useful where absolute path names are concerned. To extract files selectively, put their names in the selection file specified by the −f option: this list must be in stream order. The −F option makes listing and selective extraction much faster, but only works from disk input.
ftos records file ownership by name, not by user ID + group ID. This enables stof to extract files on another system where user names are the same, but ID numbers are different. Files with crazy ownerships will be processed with some complaint, and extracted with the ownership of the caller. Files retain their original ownership when extracted by the super user, otherwise they belong to the caller.
The format of the byte stream is machine-independent, and will be printable ASCII if the file data is likewise.
EXAMPLES
To recursively copy the current directory elsewhere, type
find . −print | ftos | stof −d elsewhere
The −depth option to find is not required. For ksh users, the following command selectively extracts all C source files, provided a.stof is disk input:
stof <a.stof −f <(stof <a.stof −t | grep ’\.c$’)
AUTHOR
rico@math.nwu.edu (Rico Tudor)
rico@cbmvax.commodore.com
FILES
/bin/mkdirdirectory creation by stof
/etc/passwdfile ownership
/etc/groupfile ownership
SEE ALSO
BUGS
Unnecessary directories are occassionally created during selective extraction.
stof cannot recover from corruption in the input stream.
— Last change: 11-dec-90