aboutsummaryrefslogtreecommitdiffstats
path: root/plpftp
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2006-05-16 11:13:10 +0000
committerReuben Thomas <rrt@sc3d.org>2006-05-16 11:13:10 +0000
commit4080ea2cbcc75c88d18e40f50777ad73ccffb714 (patch)
treeb35170ae677790a835036e8b39770eeb3e12b622 /plpftp
parent4098350c8051c2588655ae2ab81d3adf7263a094 (diff)
downloadplptools-4080ea2cbcc75c88d18e40f50777ad73ccffb714.tar.gz
plptools-4080ea2cbcc75c88d18e40f50777ad73ccffb714.tar.bz2
plptools-4080ea2cbcc75c88d18e40f50777ad73ccffb714.zip
Add settime command
Diffstat (limited to 'plpftp')
-rw-r--r--plpftp/ftp.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/plpftp/ftp.cc b/plpftp/ftp.cc
index 17afbbd..9c8a127 100644
--- a/plpftp/ftp.cc
+++ b/plpftp/ftp.cc
@@ -44,6 +44,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
+#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/stat.h>
@@ -119,6 +120,7 @@ void ftp::usage() {
cout << " runrestore <unixfile>" << endl;
cout << " machinfo" << endl;
cout << " ownerinfo" << endl;
+ cout << " settime" << endl;
cout << " setupinfo" << endl;
}
@@ -780,6 +782,11 @@ session(rfsv & a, rpcs & r, int xargc, char **xargv)
continue;
}
#endif
+ if (!strcmp(argv[0], "settime")) {
+ if ((res = r.setTime(time(NULL))) != rfsv::E_PSI_GEN_NONE)
+ cerr << _("Error: ") << res << endl;
+ continue;
+ }
if (!strcmp(argv[0], "setupinfo")) {
Enum<rfsv::errs> res;
bufferStore db;
@@ -1071,7 +1078,7 @@ static char *all_commands[] = {
"dir", "ls", "dircnt", "cd", "lcd", "get", "put", "mget", "mput",
"del", "rm", "mkdir", "rmdir", "prompt", "bye", "cp", "volname",
"ps", "kill", "killsave", "runrestore", "run", "machinfo",
- "ownerinfo", "help", "setupinfo", NULL
+ "ownerinfo", "help", "settime", "setupinfo", NULL
};
static char *localfile_commands[] = {