mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Support uploading and resuming of >2GB files.
Ref. lib/file.c.
This commit is contained in:
parent
e47b5d4e6c
commit
ec8ee4404b
15
src/main.c
15
src/main.c
@ -208,6 +208,15 @@ char *strdup(char *str)
|
|||||||
#include "curlmsg_vms.h"
|
#include "curlmsg_vms.h"
|
||||||
#endif
|
#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
|
#ifdef WIN32
|
||||||
/*
|
/*
|
||||||
* Truncate a file handle at a 64-bit position 'where'.
|
* 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);
|
config->condtime=curl_getdate(nextarg, &now);
|
||||||
if(-1 == (int)config->condtime) {
|
if(-1 == (int)config->condtime) {
|
||||||
/* now let's see if it is a file name to get the time from instead! */
|
/* 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)) {
|
if(-1 == stat(nextarg, &statbuf)) {
|
||||||
/* failed, remove time condition */
|
/* failed, remove time condition */
|
||||||
config->timecond = CURL_TIMECOND_NONE;
|
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
|
/* 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 */
|
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 */
|
/* VMS -- Danger, the filesize is only valid for stream files */
|
||||||
if(0 == stat(outfile, &fileinfo))
|
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 "-".
|
* 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 */
|
/* If no file name part is given in the URL, we add this file name */
|
||||||
char *ptr=strstr(url, "://");
|
char *ptr=strstr(url, "://");
|
||||||
|
Loading…
Reference in New Issue
Block a user