does not quit PSFTP, so you can then issue another `open' to connect
to somewhere else. This has apparently been trivial for some time,
for exactly the same reasons that `reuse-windows' was so easy, but
it hadn't occurred to me to actually do it until now.
git-svn-id: svn://svn.tartarus.org/sgt/putty@4994
cda61777-01e9-0310-a592-
d414129be87e
+int sftp_cmd_close(struct sftp_command *cmd)
+{
+ if (back == NULL) {
+ printf("psftp: not connected to a host; use \"open host.name\"\n");
+ return 0;
+ }
+
+ if (back != NULL && back->socket(backhandle) != NULL) {
+ char ch;
+ back->special(backhandle, TS_EOF);
+ sftp_recvdata(&ch, 1);
+ }
+ do_sftp_cleanup();
+
+ return 0;
+}
+
/*
* List a directory. If no arguments are given, list pwd; otherwise
* list the directory given in words[1].
/*
* List a directory. If no arguments are given, list pwd; otherwise
* list the directory given in words[1].
+ "close", TRUE, "finish your SFTP session but do not quit PSFTP",
+ "\n"
+ " Terminates your SFTP session, but does not quit the PSFTP\n"
+ " program. You can then use \"open\" to start another SFTP\n"
+ " session, to the same server or to a different one.\n",
+ sftp_cmd_close
+ },
+ {
"del", TRUE, "delete a file",
" <filename>\n"
" Delete a file.\n",
"del", TRUE, "delete a file",
" <filename>\n"
" Delete a file.\n",
back->special(backhandle, TS_EOF);
sftp_recvdata(&ch, 1);
}
back->special(backhandle, TS_EOF);
sftp_recvdata(&ch, 1);
}
random_save_seed();
cmdline_cleanup();
console_provide_logctx(NULL);
random_save_seed();
cmdline_cleanup();
console_provide_logctx(NULL);
- do_sftp_cleanup();
- backhandle = NULL;
- back = NULL;