aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2004-12-16 16:49:14 +0000
committerGisle Vanem <gvanem@broadpark.no>2004-12-16 16:49:14 +0000
commitec8ee4404becaa918bfaf1677088e662f939d74b (patch)
treec67ae115d2632b6cedde65763fe982c3ca5c797f
parente47b5d4e6c5953467f4b51f1179834dabbcc2a1e (diff)
Support uploading and resuming of >2GB files.
Ref. lib/file.c.
-rw-r--r--src/main.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 7495ee6ad..ee80fabb3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -208,6 +208,15 @@ char *strdup(char *str)
#include "curlmsg_vms.h"
#endif
+/* Support uploading and resuming of >2GB files
+ */
+#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4)
+#define struct_stat struct _stati64
+#define stat(file,st) _stati64(file,st)
+#else
+#define struct_stat struct stat
+#endif
+
#ifdef WIN32
/*
* Truncate a file handle at a 64-bit position 'where'.
@@ -2115,7 +2124,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
config->condtime=curl_getdate(nextarg, &now);
if(-1 == (int)config->condtime) {
/* now let's see if it is a file name to get the time from instead! */
- struct stat statbuf;
+ struct_stat statbuf;
if(-1 == stat(nextarg, &statbuf)) {
/* failed, remove time condition */
config->timecond = CURL_TIMECOND_NONE;
@@ -3191,7 +3200,7 @@ operate(struct Configurable *config, int argc, char *argv[])
/* We're told to continue from where we are now. Get the
size of the file as it is now and open it for append instead */
- struct stat fileinfo;
+ struct_stat fileinfo;
/* VMS -- Danger, the filesize is only valid for stream files */
if(0 == stat(outfile, &fileinfo))
@@ -3222,7 +3231,7 @@ operate(struct Configurable *config, int argc, char *argv[])
/*
* We have specified a file to upload and it isn't "-".
*/
- struct stat fileinfo;
+ struct_stat fileinfo;
/* If no file name part is given in the URL, we add this file name */
char *ptr=strstr(url, "://");