plan9port/src/cmd/netfiles/netfilelib.rc

22 lines
413 B
Text
Raw Normal View History

2005-03-21 07:37:34 +00:00
ns=`{namespace}
if(</dev/null dial 'unix!'^$ns/$1 >[2]/dev/null)
f=$f^9p
fn mysftp {
if(! </dev/null dial 'unix!'^$ns/$1.sftp >[2]/dev/null){
echo 'caching sftp' $1 >[1=2]
sftpcache -D $1
}
if(! </dev/null dial 'unix!'^$ns/$1.sftp >[2]/dev/null){
sftp -b /dev/stdin $1
}
if not{
{cat; echo DONE} | dial -e 'unix!'^$ns/$1.sftp
}
}
t=/tmp/netfilexxx.$pid.$USER
fn sigexit { rm -f $t $t.e $t.e2 }