Artifactspublic-v0

curl

master
ply4 git calls140 ms289 KiB2 cachedprotocol v2
177 lines4.8 KiBRaw

NAME

CURLOPT_QUOTE - (S)FTP commands to run before transfer

SYNOPSIS

c
#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUOTE,
                          struct curl_slist *cmds);

DESCRIPTION

Pass a pointer to a linked list of FTP or SFTP commands to pass to the server prior to your request. This is done before any other commands are issued (even before the CWD command for FTP). The linked list should be a fully valid list of 'struct curl_slist' structs properly filled in with text strings. Use curl_slist_append(3) to append strings (commands) to the list, and clear the entire list afterwards with curl_slist_free_all(3).

Using this option multiple times makes the last set list override the previous ones. Set it to NULL to disable its use again. libcurl does not copy the list, it needs to be kept around until after the transfer has completed.

When speaking to an FTP server, prefix the command with an asterisk (*) to make libcurl continue even if the command fails as by default libcurl stops at first failure.

The set of valid FTP commands depends on the server (see RFC 959 for a list of mandatory commands).

libcurl does not inspect, parse or "understand" the commands passed to the server using this option. If you change connection state, working directory or similar using quote commands, libcurl does not know about it.

The path arguments for FTP or SFTP should use double quotes to distinguish a space from being the parameter separator or being a part of the path. For example, rename with sftp using a quote command like this:

rename "test/_upload.txt" "test/Hello World.txt"

For SFTP, filenames must be provided within double quotes to embed spaces, backslashes, quotes or double quotes. Within double quotes the following escape sequences are available for that purpose: \, ", and '.

SFTP commands

atime date file

The atime command sets the last access time of the file named by the file operand. The date expression can be all sorts of date strings, see the curl_getdate(3) man page for date expression details. (Added in 7.73.0)

chgrp group file

The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID.

chmod mode file

The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number.

chown user file

The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID.

ln source_file target_file

The ln and symlink commands create a symbolic link at the target_file location pointing to the source_file location.

mkdir directory_name

The mkdir command creates the directory named by the directory_name operand.

mtime date file

The mtime command sets the last modification time of the file named by the file operand. The date expression can be all sorts of date strings, see the curl_getdate(3) man page for date expression details. (Added in 7.73.0)

pwd

The pwd command returns the absolute path of the current working directory.

rename source target

The rename command renames the file or directory named by the source operand to the destination path named by the target operand.

rm file

The rm command removes the file specified by the file operand.

rmdir directory

The rmdir command removes the directory entry specified by the directory operand, provided it is empty.

statvfs file

The statvfs command returns statistics on the file system in which specified file resides.

See ln.

DEFAULT

NULL

%PROTOCOLS%

EXAMPLE

c
int main(void)
{
  CURL *curl;
  struct curl_slist *cmdlist = NULL;
  cmdlist = curl_slist_append(cmdlist, "RNFR source-name");
  cmdlist = curl_slist_append(cmdlist, "RNTO new-name");

  curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");

    /* pass in the FTP commands to run before the transfer */
    curl_easy_setopt(curl, CURLOPT_QUOTE, cmdlist);

    result = curl_easy_perform(curl);

    curl_easy_cleanup(curl);
  }

  curl_slist_free_all(cmdlist);
}

HISTORY

SFTP support added in 7.16.3. *-prefix for SFTP added in 7.24.0

%AVAILABILITY%

RETURN VALUE

curl_easy_setopt(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3).

1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_QUOTE
5Section: 3
6Source: libcurl
7See-also:
8 - CURLOPT_CUSTOMREQUEST (3)
9 - CURLOPT_DIRLISTONLY (3)
10 - CURLOPT_POSTQUOTE (3)
11 - CURLOPT_PREQUOTE (3)
12Protocol:
13 - FTP
14 - SFTP
15Added-in: 7.1
16---
18# NAME
20CURLOPT_QUOTE - (S)FTP commands to run before transfer
22# SYNOPSIS
24~~~c
25#include <curl/curl.h>
27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUOTE,
28 struct curl_slist *cmds);
29~~~
31# DESCRIPTION
33Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
34prior to your request. This is done before any other commands are issued (even
35before the CWD command for FTP). The linked list should be a fully valid list
36of 'struct curl_slist' structs properly filled in with text strings. Use
37curl_slist_append(3) to append strings (commands) to the list, and clear
38the entire list afterwards with curl_slist_free_all(3).
40Using this option multiple times makes the last set list override the previous
41ones. Set it to NULL to disable its use again. libcurl does not copy the list,
42it needs to be kept around until after the transfer has completed.
44When speaking to an FTP server, prefix the command with an asterisk (*) to
45make libcurl continue even if the command fails as by default libcurl stops at
46first failure.
48The set of valid FTP commands depends on the server (see RFC 959 for a list of
49mandatory commands).
51libcurl does not inspect, parse or "understand" the commands passed to the
52server using this option. If you change connection state, working directory or
53similar using quote commands, libcurl does not know about it.
55The path arguments for FTP or SFTP should use double quotes to distinguish a
56space from being the parameter separator or being a part of the path. For
57example, rename with sftp using a quote command like this:
59 rename "test/_upload.txt" "test/Hello World.txt"
61For SFTP, filenames must be provided within double quotes to embed spaces,
62backslashes, quotes or double quotes. Within double quotes the following
63escape sequences are available for that purpose: \\, \", and \'.
65# SFTP commands
67## atime date file
69The atime command sets the last access time of the file named by the file
70operand. The date expression can be all sorts of date strings, see the
71curl_getdate(3) man page for date expression details. (Added in 7.73.0)
73## chgrp group file
75The chgrp command sets the group ID of the file named by the file operand to
76the group ID specified by the group operand. The group operand is a decimal
77integer group ID.
79## chmod mode file
81The chmod command modifies the file mode bits of the specified file. The
82mode operand is an octal integer mode number.
84## chown user file
86The chown command sets the owner of the file named by the file operand to the
87user ID specified by the user operand. The user operand is a decimal
88integer user ID.
90## ln source_file target_file
92The **ln** and **symlink** commands create a symbolic link at the
93target_file location pointing to the source_file location.
95## mkdir directory_name
97The mkdir command creates the directory named by the directory_name operand.
99## mtime date file
101The mtime command sets the last modification time of the file named by the
102file operand. The date expression can be all sorts of date strings, see the
103curl_getdate(3) man page for date expression details. (Added in 7.73.0)
105## pwd
107The **pwd** command returns the absolute path of the current working
108directory.
110## rename source target
112The rename command renames the file or directory named by the source
113operand to the destination path named by the target operand.
115## rm file
117The rm command removes the file specified by the file operand.
119## rmdir directory
121The rmdir command removes the directory entry specified by the directory
122operand, provided it is empty.
124## statvfs file
126The statvfs command returns statistics on the file system in which specified
127file resides.
129## symlink source_file target_file
131See ln.
133# DEFAULT
135NULL
137# %PROTOCOLS%
139# EXAMPLE
141~~~c
142int main(void)
144 CURL *curl;
145 struct curl_slist *cmdlist = NULL;
146 cmdlist = curl_slist_append(cmdlist, "RNFR source-name");
147 cmdlist = curl_slist_append(cmdlist, "RNTO new-name");
149 curl = curl_easy_init();
150 if(curl) {
151 CURLcode result;
152 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
154 /* pass in the FTP commands to run before the transfer */
155 curl_easy_setopt(curl, CURLOPT_QUOTE, cmdlist);
157 result = curl_easy_perform(curl);
159 curl_easy_cleanup(curl);
160 }
162 curl_slist_free_all(cmdlist);
164~~~
166# HISTORY
168SFTP support added in 7.16.3. *-prefix for SFTP added in 7.24.0
170# %AVAILABILITY%
172# RETURN VALUE
174curl_easy_setopt(3) returns a CURLcode indicating success or error.
176CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
177libcurl-errors(3).
Diagnostics4 git calls · 140 ms
CallStatusSizeTime0140 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=135
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2002.1 KiB135 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=2176
git.response.cache=MISS
git.response.duration_ms=135
git.fetch.wants=020d5ed95ae37307c56f2bb59b225871cd3ca959
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=2176
git.pkt.payload.max=2155
git.sideband.band1.bytes=2154
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e37f1e7a0f9318
Request
6fcadc09…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format