\documentclass{article}
\input camila.mac
\begin{document}

\INCLUDE{txt.cam}
\INCLUDE{seq.cam}
\INCLUDE{ffs.cam}
$\begin{array}{l}
ioReadPipe:str \times str \tfunc{{A^{\star}}} \\ ioReadPipe(com,opt) \deff \\ \rule{3ex}{0pt}  
\LET 
a = 
popen(com \conc \!\!\mattt{
\mbox{\texttt{" | any2sexp "}}} \conc opt,\!\!\mattt{
\mbox{\texttt{"r"}}})\\
b = 
readf(a)\\
__ = 
pclose(a) 
\IN b 
\TEL
\end{array}$

\traco

$\begin{array}{l}
ioAwk2afs:str \times str \tfunc{{\set{Atom \pfunc{Atom}}}} \\ ioAwk2afs(fn,fs) \deff \\ \rule{3ex}{0pt}  
\LET 
s = 
elems(
ioReadPipe(\!\!\mattt{
\mbox{\texttt{"cat "}}} \conc fn,\!\!\mattt{
\mbox{\texttt{" -type tab -fs "}}} \conc fs)) 
\IN  
seq2ff\hbox{-set} (s) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
ioAfs2awk:str \times {\set{NAT \pfunc{Atom}}} \times str \tfunc{SYM} \\ ioAfs2awk(fn,s,fs) \deff \\ \rule{3ex}{0pt}  
\LET 
f = 
\LAMBDA{l}
seqAddSep(l,fs) \conc \enlist{\!\!\mattt{
\mbox{\texttt{"(cr)"}}}}\\
t = \enlist{
ff2seq(\!\!\mattt{
""},x) \asor x \in s} 
\IN 
ioTxt2File(fn, 
f^* (t)) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
ioTxtPrint:txt \tfunc{SYM} \\ ioTxtPrint(t) \deff \\ \rule{3ex}{0pt}  
\LET 
p = 
txtFlat(t) \conc \enlist{\!\!\mattt{
\mbox{\texttt{"(cr)"}}}} 
\IN 
foreach(x,p,
\COND{
x = \!\!\mattt{
""}}{
princ(\!\!\mattt{
\mbox{\texttt{"."}}})}{
fputs(x)}) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
ioTxt2File:str \times txt \tfunc{SYM} \\ ioTxt2File(fn,t) \deff \\ \rule{3ex}{0pt}  
\LET 
p = 
txtFlat(t) 
\IN 
do(
sh(
strcat(\!\!\mattt{
\mbox{\texttt{"rm "}}},fn)),\_f' = 
fopen(fn,\!\!\mattt{
\mbox{\texttt{"w"}}}),
foreach(x,p,
\COND{
x = \!\!\mattt{
""}}{
princ(\!\!\mattt{
\mbox{\texttt{"."}}})}{
fputs(x,\_f)}),
fclose(\_f),
sh(
strcat(\!\!\mattt{
\mbox{\texttt{"ls -l "}}},fn))) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
ioAfsPrint:{\set{Atom \pfunc{Atom}}} \tfunc{SYM} \\ ioAfsPrint(s) \deff \\ \rule{3ex}{0pt}  
ioTxtPrint(
ffs2txt(s))
\end{array}$

\traco

$\begin{array}{l}
ioObjSave:SYM \times any \tfunc{SYM} \\ ioObjSave(n,e) \deff \\ \rule{3ex}{0pt}  
\LET 
fn = 
symstr(n) 
\IN 
do(\_f' = 
fopen(fn,\!\!\mattt{
\mbox{\texttt{"w"}}}),
fputs(fn \conc \!\!\mattt{
\mbox{\texttt{" <- "}}},\_f),
nwrite(\_f,e),
fputs(\!\!\mattt{
\mbox{\texttt{";(cr)"}}},\_f),
fclose(\_f),
sh(
strcat(\!\!\mattt{
\mbox{\texttt{"ls -l "}}},fn))) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
ioObjLoad:SYM \tfunc{SYM} \\ ioObjLoad(n) \deff \\ \rule{3ex}{0pt}  
\LET 
fn = 
symstr(n) 
\IN 
nload(fn) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
bsh' = \!\!\mattt{\mbox{\texttt{"\$$\backslash$backslash$\backslash$backslash\$"}}}
\end{array}$\\

\end{document}
