Lines Matching refs:file
10 * This software is licensed as described in the file COPYING, which
16 * furnished to do so, under the terms of the COPYING file.
59 #include "file.h"
131 data->req.p.file = calloc(1, sizeof(struct FILEPROTO));
132 if(!data->req.p.file)
141 * connect-then-transfer protocol and "connect" to the file here
146 struct FILEPROTO *file = data->req.p.file;
155 if(file->path) {
203 file->path = actual_path;
220 file->path = real_path;
227 file->path++;
236 file->path = real_path;
239 Curl_safefree(file->freepath);
240 file->freepath = real_path; /* free this when done */
242 file->fd = fd;
244 failf(data, "Couldn't open file %s", data->state.up.path);
256 struct FILEPROTO *file = data->req.p.file;
260 if(file) {
261 Curl_safefree(file->freepath);
262 file->path = NULL;
263 if(file->fd != -1)
264 close(file->fd);
265 file->fd = -1;
288 struct FILEPROTO *file = data->req.p.file;
289 const char *dir = strchr(file->path, DIRSEP);
320 fd = open(file->path, mode, data->set.new_file_perms);
322 failf(data, "Can't open %s for writing", file->path);
334 failf(data, "Can't get the size of %s", file->path);
402 * platforms we support don't allow select()ing etc on file handles (as
409 RFC 1738. Only local files (reachable via the standard file system)
411 (via NFS, Samba, NT sharing) can be accessed through a file:// URL
421 struct FILEPROTO *file;
428 file = data->req.p.file;
431 fd = file->fd;
489 /* set the file size to make it available post transfer */
495 /* Check whether file range has been specified */
504 failf(data, "Can't get the size of file.");
512 * expected_size may be -1 if we don't know how large the file is,
517 failf(data, "failed to resume file:// transfer");
531 /* The following is a shortcut implementation of file reading
533 it avoids problems with select() and recv() on file descriptors