about summary refs log tree commit diff
path: root/Doc/Zsh/mod_zftp.yo
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:11:42 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:11:42 +0000
commit20d67907c95265356b51dbdce8ecc0c1ede9e66b (patch)
tree69b0777db02f96555b3a0587cd630025062a7f09 /Doc/Zsh/mod_zftp.yo
parent2a5a899a55fd2bce10efd01c75a4bec5285aa46c (diff)
downloadzsh-20d67907c95265356b51dbdce8ecc0c1ede9e66b.tar.gz
zsh-20d67907c95265356b51dbdce8ecc0c1ede9e66b.tar.xz
zsh-20d67907c95265356b51dbdce8ecc0c1ede9e66b.zip
zsh-3.1.5-pws-5 zsh-3.1.5-pws-5
Diffstat (limited to 'Doc/Zsh/mod_zftp.yo')
-rw-r--r--Doc/Zsh/mod_zftp.yo21
1 files changed, 21 insertions, 0 deletions
diff --git a/Doc/Zsh/mod_zftp.yo b/Doc/Zsh/mod_zftp.yo
index a15be60d6..c08130bf5 100644
--- a/Doc/Zsh/mod_zftp.yo
+++ b/Doc/Zsh/mod_zftp.yo
@@ -92,6 +92,27 @@ nofill(tt(LPAR()zftp open; zftp get foo >bar; zftp close)tt(RPAR() &))
 --- here, the connection is restricted to a background subshell and
 you are free to open a simultaneous connection in the foreground.
 )
+item(tt(test))(
+Test the connection; if the server has reported
+that it has closed the connection (maybe due to a timeout), return
+status 2; if no connection was open anyway, return status 1; else
+return status 0.  The tt(test) subcommand is
+silent, apart from messages printed by the tt($ZFTP_VERBOSE)
+mechanism, or error messages if the connection closes.  There is no
+network overhead for this test.
+
+The test is only supported on systems with either the tt(select(2)) or
+tt(poll(2)) system calls; otherwise the message tt(not
+supported on this system) is printed instead.
+
+It is useful to put the code
+
+nofill(tt([[ -n $ZFTP_HOST ]] && zftp test))
+
+into the shell function tt(precmd) for testing the connection before
+every prompt.  However, tt(zftp) will call tt(test) at the start of any
+other subcommand when a connection is open.
+)
 item(tt(cd) var(directory))(
 Change the remote directory to var(directory).  Also alters the shell
 variable tt(ZFTP_PWD).