Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Conflicting statements for create_dirs and output_dir Options #11991

Closed
Rob-S opened this issue Sep 29, 2023 · 1 comment
Closed

Comments

@Rob-S
Copy link

Rob-S commented Sep 29, 2023

I did this

Looking at the man page, in docs/cmdline-opts/create-dirs.d it says:

This option creates the directories mentioned with the --output option, nothing else.

In docs/cmdline-opts/output-dir.d it says:

If the specified target directory does not exist, the operation fails unless--create-dirs is also used.

I expected the following

A) If in fact the --create-dirs option creates the directories mentioned with the --output option, nothing else (nothing else, including the --output-dir option, for example), then for the --output-dir option, whether or not the operation fails would not depend on the --create-dirs option being used or not.

or B) If whether or not the operation fails depends on --create-dir also being used when the directory specified by --output-dir does not exist, then it sounds like the --create-dirs option creates directories mentioned in either the --output option or the --output-dir option (rather than just the --output option and nothing else).

I did not create a PR since 1) I'm not 100% sure which is the correct resolution above, A) or more likely B) and someone more familiar with curl internals would be able to use the correct terminology.

curl/libcurl version

curl 7.87.0

operating system

N/A

@bagder
Copy link
Member

bagder commented Sep 29, 2023

How about this as an update for the --create-dirs documentation?

When used in conjunction with the --output option, curl creates the necessary
local directory hierarchy as needed. This option creates the directories
mentioned with the --output option combined with the path possibly set with
--output-dir. If the combined output file name uses no directory, or if the
directories it mentions already exist, no directories are created.

bagder added a commit that referenced this issue Sep 29, 2023
@bagder bagder self-assigned this Sep 29, 2023
@bagder bagder closed this as completed in 5bbe732 Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants