summaryrefslogtreecommitdiffstats
path: root/libftp
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2003-03-17 20:36:48 +0100
committerJudd Vinet <judd@archlinux.org>2003-03-17 20:36:48 +0100
commit185ce5454e4afd11b1f90d7fe487b0ec3cb840c7 (patch)
treea4ef279317d6fce3e5c4fd00ede528ea62e1c7ed /libftp
parent0207fad046f76fc37c0fc7c8b6a157225024a3ed (diff)
downloadpacman-185ce5454e4afd11b1f90d7fe487b0ec3cb840c7.tar.gz
pacman-185ce5454e4afd11b1f90d7fe487b0ec3cb840c7.tar.xz
Imported from pacman-2.3.2.tar.gz
Diffstat (limited to 'libftp')
-rw-r--r--libftp/ftplib.c18
-rw-r--r--libftp/ftplib.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/libftp/ftplib.c b/libftp/ftplib.c
index 9089a5b3..d8c25f58 100644
--- a/libftp/ftplib.c
+++ b/libftp/ftplib.c
@@ -1104,7 +1104,7 @@ static int FtpXfer(const char *localfile, const char *path,
if (localfile != NULL)
{
- char ac[4] = "w";
+ char ac[4] = "a";
if (typ == FTPLIB_FILE_WRITE)
ac[0] = 'r';
if (mode == FTPLIB_IMAGE)
@@ -1200,6 +1200,22 @@ GLOBALDEF int FtpSize(const char *path, int *size, char mode, netbuf *nControl)
}
/*
+ * FtpRestart - issue a REST command
+ *
+ * return 1 if successful, 0 otherwise
+ */
+GLOBALDEF int FtpRestart(int offset, netbuf *nControl)
+{
+ char cmd[256];
+ int rv=1;
+
+ sprintf(cmd,"REST %d",offset);
+ if (!FtpSendCmd(cmd,'3',nControl))
+ rv = 0;
+ return rv;
+}
+
+/*
* FtpModDate - determine the modification date of a remote file
*
* return 1 if successful, 0 otherwise
diff --git a/libftp/ftplib.h b/libftp/ftplib.h
index c281b723..05bdf9e1 100644
--- a/libftp/ftplib.h
+++ b/libftp/ftplib.h
@@ -109,6 +109,7 @@ GLOBALREF int FtpPwd(char *path, int max, netbuf *nControl);
GLOBALREF int FtpNlst(const char *output, const char *path, netbuf *nControl);
GLOBALREF int FtpDir(const char *output, const char *path, netbuf *nControl);
GLOBALREF int FtpSize(const char *path, int *size, char mode, netbuf *nControl);
+GLOBALREF int FtpRestart(int offset, netbuf *nControl);
GLOBALREF int FtpModDate(const char *path, char *dt, int max, netbuf *nControl);
GLOBALREF int FtpGet(const char *output, const char *path, char mode,
netbuf *nControl);