26 #ifndef CURL_DISABLE_FILE
33 #include <sys/types.h>
38 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
43 #ifdef HAVE_SYS_SOCKET_H
44 #include <sys/socket.h>
46 #ifdef HAVE_NETINET_IN_H
47 #include <netinet/in.h>
56 #ifdef HAVE_ARPA_INET_H
57 #include <arpa/inet.h>
62 #include <sys/ioctl.h>
65 #ifdef HAVE_SYS_PARAM_H
66 #include <sys/param.h>
69 #ifdef HAVE_SYS_STAT_H
89 #define _MPRINTF_REPLACE
103 #if defined(WIN32) || defined(__EMX__)
114 #if defined(WIN32) || defined(__EMX__)
129 actual_path = real_path;
130 if ((actual_path[0] ==
'/') &&
132 (actual_path[2] ==
':' || actual_path[2] ==
'|'))
134 actual_path[2] =
':';
139 for (i=0; actual_path[
i] !=
'\0'; ++
i)
140 if (actual_path[i] ==
'/')
141 actual_path[
i] =
'\\';
143 fd = open(actual_path,
O_RDONLY | O_BINARY);
158 #if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4)
159 #define lseek(x,y,z) _lseeki64(x, y, z)
190 if( -1 != fstat(fd, &statbuf)) {
192 expected_size = statbuf.st_size;
206 sprintf(buf,
"Accept-ranges: bytes\r\n");
214 time_t clock = (time_t)statbuf.st_mtime;
217 tm = (
struct tm *)gmtime_r(&clock, &
buffer);
222 strftime(buf,
BUFSIZE-1,
"Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
237 if (fstated && (expected_size == 0))
253 nread = read(fd, buf,
BUFSIZE-1);
void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size)
CURLcode Curl_file_connect(struct connectdata *conn)
char * curl_unescape(const char *string, int length)
CURLcode Curl_initinfo(struct SessionHandle *data)
union connectdata::@11 proto
void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
CURLcode Curl_client_write(struct SessionHandle *data, int type, char *ptr, size_t len)
int Curl_pgrsUpdate(struct connectdata *conn)
void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size)
GLsizei GLsizei GLenum GLenum const GLvoid * data
struct tm * gmtime(const time_t *)
CURLcode Curl_speedcheck(struct SessionHandle *data, struct timeval now)
struct SessionHandle * data
CURLcode Curl_file(struct connectdata *conn)
struct timeval Curl_tvnow(void)
CURLcode Curl_readwrite_init(struct connectdata *conn)
void Curl_pgrsStartNow(struct SessionHandle *data)
int sprintf(idStr &string, const char *fmt,...)
#define CURLE_FTP_BAD_DOWNLOAD_RESUME