| 1 |
.\" ************************************************************************** |
| 2 |
.\" * _ _ ____ _ |
| 3 |
.\" * Project ___| | | | _ \| | |
| 4 |
.\" * / __| | | | |_) | | |
| 5 |
.\" * | (__| |_| | _ <| |___ |
| 6 |
.\" * \___|\___/|_| \_\_____| |
| 7 |
.\" * |
| 8 |
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <[email protected]>, et al. |
| 9 |
.\" * |
| 10 |
.\" * This software is licensed as described in the file COPYING, which |
| 11 |
.\" * you should have received as part of this distribution. The terms |
| 12 |
.\" * are also available at https://curl.haxx.se/docs/copyright.html. |
| 13 |
.\" * |
| 14 |
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| 15 |
.\" * copies of the Software, and permit persons to whom the Software is |
| 16 |
.\" * furnished to do so, under the terms of the COPYING file. |
| 17 |
.\" * |
| 18 |
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 19 |
.\" * KIND, either express or implied. |
| 20 |
.\" * |
| 21 |
.\" ************************************************************************** |
| 22 |
.\" |
| 23 |
.TH CURLOPT_QUOTE 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options" |
| 24 |
.SH NAME |
| 25 |
CURLOPT_QUOTE \- (S)FTP commands to run before transfer |
| 26 |
.SH SYNOPSIS |
| 27 |
#include <curl/curl.h> |
| 28 |
|
| 29 |
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUOTE, struct curl_slist *cmds); |
| 30 |
.SH DESCRIPTION |
| 31 |
Pass a pointer to a linked list of FTP or SFTP commands to pass to the server |
| 32 |
prior to your request. This will be done before any other commands are issued |
| 33 |
(even before the CWD command for FTP). The linked list should be a fully valid |
| 34 |
list of 'struct curl_slist' structs properly filled in with text strings. Use |
| 35 |
\fIcurl_slist_append(3)\fP to append strings (commands) to the list, and clear |
| 36 |
the entire list afterwards with \fIcurl_slist_free_all(3)\fP. Disable this |
| 37 |
operation again by setting a NULL to this option. When speaking to an FTP |
| 38 |
server, prefix the command with an asterisk (*) to make libcurl continue even |
| 39 |
if the command fails as by default libcurl will stop at first failure. |
| 40 |
|
| 41 |
The set of valid FTP commands depends on the server (see RFC959 for a list of |
| 42 |
mandatory commands). |
| 43 |
|
| 44 |
The valid SFTP commands are: |
| 45 |
.RS |
| 46 |
.IP "chgrp group file" |
| 47 |
The chgrp command sets the group ID of the file named by the file operand to |
| 48 |
the group ID specified by the group operand. The group operand is a decimal |
| 49 |
integer group ID. |
| 50 |
.IP "chmod mode file" |
| 51 |
The chmod command modifies the file mode bits of the specified file. The |
| 52 |
mode operand is an octal integer mode number. |
| 53 |
.IP "chown user file" |
| 54 |
The chown command sets the owner of the file named by the file operand to the |
| 55 |
user ID specified by the user operand. The user operand is a decimal |
| 56 |
integer user ID. |
| 57 |
.IP "ln source_file target_file" |
| 58 |
The ln and symlink commands create a symbolic link at the target_file location |
| 59 |
pointing to the source_file location. |
| 60 |
.IP "mkdir directory_name" |
| 61 |
The mkdir command creates the directory named by the directory_name operand. |
| 62 |
.IP "pwd" |
| 63 |
The pwd command returns the absolute pathname of the current working directory. |
| 64 |
.IP "rename source target" |
| 65 |
The rename command renames the file or directory named by the source |
| 66 |
operand to the destination path named by the target operand. |
| 67 |
.IP "rm file" |
| 68 |
The rm command removes the file specified by the file operand. |
| 69 |
.IP "rmdir directory" |
| 70 |
The rmdir command removes the directory entry specified by the directory |
| 71 |
operand, provided it is empty. |
| 72 |
.IP "statvfs file" |
| 73 |
The statvfs command returns statistics on the file system in which specified |
| 74 |
file resides. (Added in 7.49.0) |
| 75 |
.IP "symlink source_file target_file" |
| 76 |
See ln. |
| 77 |
.RE |
| 78 |
.SH DEFAULT |
| 79 |
NULL |
| 80 |
.SH PROTOCOLS |
| 81 |
SFTP and FTP |
| 82 |
.SH EXAMPLE |
| 83 |
.nf |
| 84 |
struct curl_slist *cmdlist = NULL; |
| 85 |
cmdlist = curl_slist_append(cmdlist, "RNFR source-name"); |
| 86 |
cmdlist = curl_slist_append(cmdlist, "RNTO new-name"); |
| 87 |
|
| 88 |
curl = curl_easy_init(); |
| 89 |
if(curl) { |
| 90 |
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin"); |
| 91 |
|
| 92 |
/* pass in the FTP commands to run before the transfer */ |
| 93 |
curl_easy_setopt(curl, CURLOPT_QUOTE, cmdlist); |
| 94 |
|
| 95 |
ret = curl_easy_perform(curl); |
| 96 |
|
| 97 |
curl_easy_cleanup(curl); |
| 98 |
} |
| 99 |
.fi |
| 100 |
.SH AVAILABILITY |
| 101 |
SFTP support added in 7.16.3. *-prefix for SFTP added in 7.24.0 |
| 102 |
.SH RETURN VALUE |
| 103 |
Returns CURLE_OK |
| 104 |
.SH "SEE ALSO" |
| 105 |
.BR CURLOPT_POSTQUOTE "(3), " CURLOPT_PREQUOTE "(3), " |