NAME

io.cam - a standard i/o CAMILA library


SYNOPSYS

ioAwk2afs(fn:STR,fs:STR):(At->At)-set ioAfs2awk(fn:STR,s:(INT->At)-set,fs:STR):SYM ioTxtPrint(t:txt):SYM ioTxt2File(fn:STR,t:txt):SYM ioAfsPrint(s:(At->At)-set):SYM ioReadPipe(com:STR,opt:STR): A-seq ioObjSave(n:SYM,e:ANY):SYM ioObjLoad(n:SYM):SYM


DESCRIPTION

This library contains a few i/o functions,

including reading from UNIX pipes.

This includes output functions for the (A->B)-set functor

in ffs.cam to the particular case where both A and B are atomic,

that is, A = B = STR | INT | SYM.

The informal semantics of the operators are as follows:

ioAwk2afs(fn:STR,fs:STR):(At->At)-set
ioAwk2afs(fn,fs) - read ``afs from awk-like file'' - reads file fn which is supposed to be in awk-like format, where RS = newline and FS = fs and converts it to an STR-afs.

ioAfs2awk(fn:STR,s:(INT->At)-set,fs:STR):SYM
ioAfs2awk(fn,s,fs) is the converse of ioAwk2afs(fn,fs), wwhere s is an INT to Atom finite mapping set to be stored in file fn in awk-like format such that FS = fs. The domain of every entry in s should be an initial segment. Otherwise, ``holes'' will be filled in by the empty string.

ioTxtPrint(t:txt):SYM
ioTxtPrint(t) writes txt object t to the standard output.

ioTxt2File(fn:STR,t:txt):SYM
ioTxt2File(fn,t) writes txt object t into file fn.

ioAfsPrint(s:(At->At)-set):SYM
ioAfsPrint(s) sends afs object to the standard output, after a ffs2txt conversion.

ioReadPipe(com:STR,opt:STR): A-seq
ioReadPipe(com,opt) opens, reads and closes a Unix pipe created by process ``com'', the output of which is passed through the 'any2sexp' (Perl) filter. See the documentation of 'any2sexp' for the options string you may add to the command. In many situations str=``'' will do, eg. ioReadPipe(``ls *.cam'',``'').

ioObjSave(n:SYM,e:ANY):SYM
ioObjSave(n,e) performs a textual save of any expression 'e' under name 'n' into file ``n''.

ioObjLoad(n:SYM):SYM
ioObjLoad(n) loads object 'n' from file ``n'' where it was previously saved by ioObjSave.


SEE ALSO

Manual(s) of txt.cam seq.cam ffs.cam.