about summary refs log tree commit diff
path: root/Functions/Zftp/zfput
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-25 15:43:41 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-25 15:43:41 +0000
commit206237c8ec4b7619d9e70a75004cd1ae1066b0a0 (patch)
treeff703cbc295605f90755edb68672ed2de11f4a81 /Functions/Zftp/zfput
parent8ceb54fbc2f879e0e80f58c18761bd54db07e5f7 (diff)
downloadzsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.gz
zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.tar.xz
zsh-206237c8ec4b7619d9e70a75004cd1ae1066b0a0.zip
Diffstat (limited to 'Functions/Zftp/zfput')
-rw-r--r--Functions/Zftp/zfput23
1 files changed, 23 insertions, 0 deletions
diff --git a/Functions/Zftp/zfput b/Functions/Zftp/zfput
new file mode 100644
index 000000000..0687163f0
--- /dev/null
+++ b/Functions/Zftp/zfput
@@ -0,0 +1,23 @@
+# function zfput {
+# Simple put:  dump every file under the same name, but stripping
+# off any directory parts to get the remote filename (i.e. always
+# goes into current remote directory).  Use zfpcp to specify new
+# file name or new directory at remote end.
+
+emulate -L zsh
+
+local loc rem
+integer stat do_close
+
+zfautocheck
+
+for loc in $*; do
+  rem=${loc:t}
+  zftp put $rem <$loc
+  [[ $? == 0 ]] || stat=$?
+done
+
+(( $do_close )) && zfclose
+
+return $stat
+# }