From 733aa12868e838e825e785f7f3e774164b37cb2c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 15 Dec 2023 13:37:47 +0100 Subject: [PATCH] use filename, not file name --- SUMMARY.md | 2 +- cmdline/configfile.md | 2 +- cmdline/globbing.md | 6 +++--- ftp/upload.md | 6 +++--- http/multipart.md | 2 +- http/post/simple.md | 4 ++-- libcurl-http/cookies.md | 8 ++++---- libcurl-http/hsts.md | 4 ++-- libcurl/callbacks/ftpmatch.md | 4 ++-- libcurl/options/all.md | 12 ++++++------ usingcurl/downloads.md | 2 +- usingcurl/downloads/content-disp.md | 16 ++++++++-------- usingcurl/downloads/resume.md | 2 +- usingcurl/downloads/storing.md | 8 ++++---- usingcurl/downloads/url-named.md | 10 +++++----- usingcurl/tls/pinning.md | 2 +- usingcurl/tls/sslkeylogfile.md | 6 +++--- usingcurl/uploads.md | 8 ++++---- usingcurl/verbose/trace.md | 4 ++-- 19 files changed, 54 insertions(+), 54 deletions(-) diff --git a/SUMMARY.md b/SUMMARY.md index 8af285a217..a5d694887a 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -81,7 +81,7 @@ * [What exactly is downloading?](usingcurl/downloads/whatis.md) * [Storing downloads](usingcurl/downloads/storing.md) * [Download to a file named by the URL](usingcurl/downloads/url-named.md) - * [Use the target file name from the server](usingcurl/downloads/content-disp.md) + * [Use the target filename from the server](usingcurl/downloads/content-disp.md) * [HTML and charsets](usingcurl/downloads/charsets.md) * [Compression](usingcurl/downloads/compression.md) * [Shell redirects](usingcurl/downloads/redirects.md) diff --git a/cmdline/configfile.md b/cmdline/configfile.md index 26aa8fc7c5..4309b95839 100644 --- a/cmdline/configfile.md +++ b/cmdline/configfile.md @@ -15,7 +15,7 @@ You tell curl to read more command-line options from a specific file with the curl -K cmdline.txt http://example.com -…and in the `cmdline.txt` file (which, of course, can use any file name you +…and in the `cmdline.txt` file (which, of course, can use any filename you please) you enter each command line per line: # this is a comment, we ask to follow redirects diff --git a/cmdline/globbing.md b/cmdline/globbing.md index 1874cb743b..630df95a28 100644 --- a/cmdline/globbing.md +++ b/cmdline/globbing.md @@ -73,12 +73,12 @@ both the web server and the mail server: In all the globbing examples previously in this chapter we have selected to use the `-O / --remote-name` option, which makes curl save the target file -using the file name part of the used URL. +using the filename part of the used URL. Sometimes that is not enough. You are downloading multiple files and maybe you -want to save them in a different subdirectory or create the saved file names +want to save them in a different subdirectory or create the saved filenames differently. curl, of course, has a solution for these situations as well: -output file name variables. +output filename variables. Each "glob" used in a URL gets a separate variable. They are referenced as `#[num]` - that means the single character `#` followed by the glob number diff --git a/ftp/upload.md b/ftp/upload.md index aff612657c..77894ff2ed 100644 --- a/ftp/upload.md +++ b/ftp/upload.md @@ -1,16 +1,16 @@ # Uploading with FTP To upload to an FTP server, you specify the entire target file path and name -in the URL, and you specify the local file name to upload with `-T, +in the URL, and you specify the local filename to upload with `-T, --upload-file`. Optionally, you end the target URL with a slash and then the file component from the local path will be appended by curl and used as the -remote file name. +remote filename. Like: curl -T localfile ftp://ftp.example.com/dir/path/remote-file -or to use the local file name as the remote name: +or to use the local filename as the remote name: curl -T localfile ftp://ftp.example.com/dir/path/ diff --git a/http/multipart.md b/http/multipart.md index 7e56be6366..f920f4f545 100644 --- a/http/multipart.md +++ b/http/multipart.md @@ -158,7 +158,7 @@ When the input type is set to a "file", like in: -You provide a file for this part by specifying the file name and use `@` and +You provide a file for this part by specifying the filename and use `@` and the path to the file to include: curl -F image=@funnycat.gif https://example.com/ diff --git a/http/post/simple.md b/http/post/simple.md index d9b30974cf..c27e1335f6 100644 --- a/http/post/simple.md +++ b/http/post/simple.md @@ -14,7 +14,7 @@ also be written like this: curl -d name=admin -d shoesize=12 http://example.com/ If the amount of data to send is too large for a mere string on the -command line, you can also read it from a file name in standard curl style: +command line, you can also read it from a filename in standard curl style: curl -d @filename http://example.com @@ -23,7 +23,7 @@ curl does not encode or change the data you tell it to send. **curl sends exactly the bytes you give it**. To send a POST body that starts with a `@` symbol, to avoid that curl tries to -load that as a file name, use `--data-raw` instead. This option has no file +load that as a filename, use `--data-raw` instead. This option has no file loading capability: curl --data-raw '@string' https://example.com diff --git a/libcurl-http/cookies.md b/libcurl-http/cookies.md index b1ed9d026d..6391f15d45 100644 --- a/libcurl-http/cookies.md +++ b/libcurl-http/cookies.md @@ -22,12 +22,12 @@ There are two ways to switch on the cookie engine: ### Enable cookie engine with reading -Ask libcurl to import cookies into the easy handle from a given file name with +Ask libcurl to import cookies into the easy handle from a given filename with the `CURLOPT_COOKIEFILE` option: curl_easy_setopt(easy, CURLOPT_COOKIEFILE, "cookies.txt"); -A common trick is to just specify a non-existing file name or plain "" to have +A common trick is to just specify a non-existing filename or plain "" to have it just activate the cookie engine with a blank cookie store to start with. This option can be set multiple times and then each of the given files will be @@ -113,12 +113,12 @@ Erase all session cookies (cookies without expiry date) from memory: curl_easy_setopt(curl, CURLOPT_COOKIELIST, "SESS"); -Force a write of all cookies to the file name previously specified with +Force a write of all cookies to the filename previously specified with `CURLOPT_COOKIEJAR`: curl_easy_setopt(curl, CURLOPT_COOKIELIST, "FLUSH"); -Force a reload of cookies from the file name previously specified with +Force a reload of cookies from the filename previously specified with `CURLOPT_COOKIEFILE`: curl_easy_setopt(curl, CURLOPT_COOKIELIST, "RELOAD"); diff --git a/libcurl-http/hsts.md b/libcurl-http/hsts.md index 0d36e79ed1..f8646b8ca6 100644 --- a/libcurl-http/hsts.md +++ b/libcurl-http/hsts.md @@ -21,11 +21,11 @@ be used, but `CURLHSTS_ENABLE` is the primary one. If that is set, then this easy handle how has HSTS support enabled. The second flag available for this option is `CURLHSTS_READONLYFILE`, which if -set, tells libcurl that the file name you specify for it to use as a HSTS +set, tells libcurl that the filename you specify for it to use as a HSTS cache is only to be read from, and not write anything back to. ## Set a HSTS cache file -If you want to persist the HSTS cache on disk, then set a file name with the +If you want to persist the HSTS cache on disk, then set a filename with the `CURLOPT_HSTS` option. libcurl will read from this file at start of a transfer and write to it (unless it was set read-only) when the easy handle is closed. diff --git a/libcurl/callbacks/ftpmatch.md b/libcurl/callbacks/ftpmatch.md index 794b5f0062..c56e94ca4d 100644 --- a/libcurl/callbacks/ftpmatch.md +++ b/libcurl/callbacks/ftpmatch.md @@ -2,7 +2,7 @@ libcurl supports FTP wildcard matching. You use this feature by setting `CURLOPT_WILDCARDMATCH` to `1L` and then use a "wildcard pattern" in the in -the file name part of the URL. +the filename part of the URL. ## Wildcard patterns @@ -42,7 +42,7 @@ alpha, digit, print, upper, blank, graph, xdigit. `[\\[\\]\\\\]` - escape syntax. Matches `[`, `]` or `\\`. -Using the rules above, a file name pattern can be constructed: +Using the rules above, a filename pattern can be constructed: ftp://example.com/some/path/[a-z[:upper:]\\\\].jpeg diff --git a/libcurl/options/all.md b/libcurl/options/all.md index 1f54aa41bf..40576af989 100644 --- a/libcurl/options/all.md +++ b/libcurl/options/all.md @@ -10,7 +10,7 @@ This is a table of a complete list of all available options for | `CURLOPT_ACCEPTTIMEOUT_MS` | timeout waiting for FTP server to connect back | | `CURLOPT_ACCEPT_ENCODING` | automatic decompression of HTTP downloads | | `CURLOPT_ADDRESS_SCOPE` | scope id for IPv6 addresses | -| `CURLOPT_ALTSVC` | alt-svc cache file name | +| `CURLOPT_ALTSVC` | alt-svc cache filename | | `CURLOPT_ALTSVC_CTRL` | control alt-svc behavior | | `CURLOPT_APPEND` | append to the remote file | | `CURLOPT_AUTOREFERER` | automatically update the referer header | @@ -33,8 +33,8 @@ This is a table of a complete list of all available options for | `CURLOPT_CONV_FROM_UTF8_FUNCTION` | convert data from UTF8 to host encoding | | `CURLOPT_CONV_TO_NETWORK_FUNCTION` | convert data to network from host encoding | | `CURLOPT_COOKIE` | HTTP Cookie header | -| `CURLOPT_COOKIEFILE` | file name to read cookies from | -| `CURLOPT_COOKIEJAR` | file name to store cookies to | +| `CURLOPT_COOKIEFILE` | filename to read cookies from | +| `CURLOPT_COOKIEJAR` | filename to store cookies to | | `CURLOPT_COOKIELIST` | add to or manipulate cookies held in memory | | `CURLOPT_COOKIESESSION` | start a new cookie session | | `CURLOPT_COPYPOSTFIELDS` | have libcurl copy data to POST | @@ -87,7 +87,7 @@ This is a table of a complete list of all available options for | `CURLOPT_HEADERDATA` | pointer to pass to header callback | | `CURLOPT_HEADERFUNCTION` | callback that receives header data | | `CURLOPT_HEADEROPT` | send HTTP headers to both proxy and host or separately | -| `CURLOPT_HSTS` | HSTS cache file name | +| `CURLOPT_HSTS` | HSTS cache filename | | `CURLOPT_HSTSREADDATA` | pointer passed to the HSTS read callback | | `CURLOPT_HSTSREADFUNCTION` | read callback for HSTS hosts | | `CURLOPT_HSTSWRITEDATA` | pointer passed to the HSTS write callback | @@ -137,7 +137,7 @@ This is a table of a complete list of all available options for | `CURLOPT_MIMEPOST` | send data from mime structure | | `CURLOPT_MIME_OPTIONS` | set MIME option flags | | `CURLOPT_NETRC` | enable use of .netrc | -| `CURLOPT_NETRC_FILE` | file name to read .netrc info from | +| `CURLOPT_NETRC_FILE` | filename to read .netrc info from | | `CURLOPT_NEW_DIRECTORY_PERMS` | permissions for remotely created directories | | `CURLOPT_NEW_FILE_PERMS` | permissions for remotely created files | | `CURLOPT_NOBODY` | do the download request without getting the body | @@ -235,7 +235,7 @@ This is a table of a complete list of all available options for | `CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256` | SHA256 hash of SSH server public key | | `CURLOPT_SSH_KEYDATA` | pointer passed to the SSH key callback | | `CURLOPT_SSH_KEYFUNCTION` | callback for known host matching logic | -| `CURLOPT_SSH_KNOWNHOSTS` | file name holding the SSH known hosts | +| `CURLOPT_SSH_KNOWNHOSTS` | filename holding the SSH known hosts | | `CURLOPT_SSH_PRIVATE_KEYFILE` | private key file for SSH auth | | `CURLOPT_SSH_PUBLIC_KEYFILE` | public key file for SSH auth | | `CURLOPT_SSLCERT` | SSL client certificate | diff --git a/usingcurl/downloads.md b/usingcurl/downloads.md index c263bac731..470732974b 100644 --- a/usingcurl/downloads.md +++ b/usingcurl/downloads.md @@ -10,7 +10,7 @@ specific data pointed to by a URL onto your machine. * [What exactly is downloading?](downloads/whatis.md) * [Storing downloads](downloads/storing.md) * [Download to a file named by the URL](downloads/url-named.md) -* [Use the target file name from the server](downloads/content-disp.md) + * [Use the target filename from the server](downloads/content-disp.md) * [HTML and charsets](downloads/charsets.md) * [Compression](downloads/compression.md) * [Shell redirects](downloads/redirects.md) diff --git a/usingcurl/downloads/content-disp.md b/usingcurl/downloads/content-disp.md index 983badfcb9..182291c9b5 100644 --- a/usingcurl/downloads/content-disp.md +++ b/usingcurl/downloads/content-disp.md @@ -1,25 +1,25 @@ -# Use the target file name from the server +# Use the target filename from the server HTTP servers have the option to provide a header named `Content-Disposition:` -in responses. That header may contain a suggested file name for the contents +in responses. That header may contain a suggested filename for the contents delivered, and curl can be told to use that hint to name its local file. The `-J / --remote-header-name` enables this. If you also use the `-O` option, -it makes curl use the file name from the URL by default and only *if* +it makes curl use the filename from the URL by default and only *if* there is actually a valid Content-Disposition header available, it switches to saving using that name. `-J` has some problems and risks associated with it that users need to be aware of: -1. It will only use the rightmost part of the suggested file name, so any path +1. It will only use the rightmost part of the suggested filename, so any path or directories the server suggests will be stripped out. -2. Since the file name is entirely selected by the server, curl will, of +2. Since the filename is entirely selected by the server, curl will, of course, overwrite any preexisting local file in your current directory if the -server happens to provide such a file name. +server happens to provide such a filename. -3. File name encoding and character sets issues. curl does not decode the name -in any way, so you may end up with a URL-encoded file name where a browser +3. filename encoding and character sets issues. curl does not decode the name +in any way, so you may end up with a URL-encoded filename where a browser would otherwise decode it to something more readable using a sensible character set. diff --git a/usingcurl/downloads/resume.md b/usingcurl/downloads/resume.md index b96080b8c0..e69e1b8f38 100644 --- a/usingcurl/downloads/resume.md +++ b/usingcurl/downloads/resume.md @@ -9,7 +9,7 @@ curl supports resumed downloads on several protocols. Tell it where to start the transfer with the `-C, --continue-at` option that takes either a plain numerical byte counter offset where to start or the string `-` that asks curl to figure it out itself based on what it knows. When using `-`, curl will use -the destination file name to figure out how much data that is already present +the destination filename to figure out how much data that is already present locally and ask use that as an offset when asking for more data from the server. diff --git a/usingcurl/downloads/storing.md b/usingcurl/downloads/storing.md index b5a3123c4a..8ab53d56a0 100644 --- a/usingcurl/downloads/storing.md +++ b/usingcurl/downloads/storing.md @@ -6,9 +6,9 @@ something else. Outputting data to stdout is really useful when you want to pipe it into another program or similar, but it is not always the optimal way to deal with your downloads. -Give curl a specific file name to save the download in with `-o [filename]` +Give curl a specific filename to save the download in with `-o [filename]` (with `--output` as the long version of the option), where filename is either -just a file name, a relative path to a file name or a full path to the file. +just a filename, a relative path to a filename or a full path to the file. Also note that you can put the `-o` before or after the URL; it makes no difference: @@ -33,14 +33,14 @@ follow. ## Overwriting -When curl downloads a remote resource into a local file name as described +When curl downloads a remote resource into a local filename as described above, it will overwrite that file in case it already existed. It will *clobber* it. curl offers a way to avoid this clobbering: `--no-clobber`. When using this option, and curl finds that there already exists a file with -the given name, curl instead appends a period plus a number to the file name +the given name, curl instead appends a period plus a number to the filename in an attempt to find a name that is not already used. It will start with `1` and then continue trying until it reaches `100` and pick the first available one. diff --git a/usingcurl/downloads/url-named.md b/usingcurl/downloads/url-named.md index e061a41361..994f28770b 100644 --- a/usingcurl/downloads/url-named.md +++ b/usingcurl/downloads/url-named.md @@ -1,6 +1,6 @@ # Download to a file named by the URL -Many URLs, however, already contain the file name part in the rightmost +Many URLs, however, already contain the filename part in the rightmost end. curl lets you use that as a shortcut so you do not have to repeat it with `-o`. So instead of: @@ -11,13 +11,13 @@ You can save the remote URL resource into the local file 'file.html' with this: curl -O http://example.com/file.html This is the `-O` (uppercase letter o) option, or `--remote-name` for the long -name version. The -O option selects the local file name to use by picking the -file name part of the URL that you provide. This is important. You specify the +name version. The -O option selects the local filename to use by picking the +filename part of the URL that you provide. This is important. You specify the URL and curl picks the name from this data. If the site redirects curl further -(and if you tell curl to follow redirects), it does not change the file name +(and if you tell curl to follow redirects), it does not change the filename curl will use for storing this. -## Use the URL's file name part for all URLs +## Use the URL's filename part for all URLs As a reaction to adding a hundred `-O` options when using a hundred URLs, we introduced an option called `--remote-name-all`. This makes `-O` the default diff --git a/usingcurl/tls/pinning.md b/usingcurl/tls/pinning.md index 7e30e14971..9b533f3a7f 100644 --- a/usingcurl/tls/pinning.md +++ b/usingcurl/tls/pinning.md @@ -8,7 +8,7 @@ indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key provided to this option, curl will abort the connection before sending or receiving any data. -You tell curl a file name to read the sha256 value from, or you specify the +You tell curl a filename to read the sha256 value from, or you specify the base64 encoded hash directly in the command line with a `sha256//` prefix. You can specify one or more hashes like that, separated with semicolons (;). diff --git a/usingcurl/tls/sslkeylogfile.md b/usingcurl/tls/sslkeylogfile.md index d7ea75378b..c128a8800a 100644 --- a/usingcurl/tls/sslkeylogfile.md +++ b/usingcurl/tls/sslkeylogfile.md @@ -8,10 +8,10 @@ This is similarly possible to do with curl. You do this by making the browser or curl tell Wireshark the encryption secrets so that it can decrypt them: -1. set the environment variable named `SSLKEYLOGFILE` to a file name of your choice before you start the browser or curl -2. Setting the same file name path in the Master-secret field in Wireshark. Go to Preferences->Protocols->TLS and edit the path as shown in the screenshot below. +1. set the environment variable named `SSLKEYLOGFILE` to a filename of your choice before you start the browser or curl +2. Setting the same filename path in the Master-secret field in Wireshark. Go to Preferences->Protocols->TLS and edit the path as shown in the screenshot below. -![set the ssl key file name](wireshark-ssl-master-secret.png) +![set the ssl key filename](wireshark-ssl-master-secret.png) Having done this simple operation, you can now inspect curl's or your browser's HTTPS traffic in Wireshark. Just super handy and awesome. diff --git a/usingcurl/uploads.md b/usingcurl/uploads.md index 6ef7676b8d..a56e9d4c45 100644 --- a/usingcurl/uploads.md +++ b/usingcurl/uploads.md @@ -61,13 +61,13 @@ You send off an HTTP upload using the -T option with the file to upload: Working with FTP, you get to see the remote file system you will be accessing. You tell the server exactly in which directory you want the upload to be -placed and which file name to use. If you specify the upload URL with a -trailing slash, curl will append the locally used file name to the URL and -then that will be the file name used when stored remotely: +placed and which filename to use. If you specify the upload URL with a +trailing slash, curl will append the locally used filename to the URL and +then that will be the filename used when stored remotely: curl -T uploadthis ftp://example.com/this/directory/ -So if you prefer to select a different file name on the remote side than what +So if you prefer to select a different filename on the remote side than what you have used locally, you specify it in the URL: curl -T uploadthis ftp://example.com/this/directory/remotename diff --git a/usingcurl/verbose/trace.md b/usingcurl/verbose/trace.md index d7d1246e98..3a05c67899 100644 --- a/usingcurl/verbose/trace.md +++ b/usingcurl/verbose/trace.md @@ -9,8 +9,8 @@ tcpdump) will not be able to do this job as easily for you. For this, curl offers two other options that you use instead of `-v`. -`--trace [filename]` will save a full trace in the given file name. You can -also use '-' (a single minus) instead of a file name to get it passed to +`--trace [filename]` will save a full trace in the given filename. You can +also use '-' (a single minus) instead of a filename to get it passed to stdout. You would use it like this: $ curl --trace dump http://example.com