Skip to content

Unuseful warnings with --xattr/--remote-time + --output /dev/null #6533

@vszakats

Description

@vszakats

When using the pattern curl <URL> --output /dev/null (typically in conjunction with --write-out '%{<format>}' to read the <format> value without actually retrieving the URL content), while having --xattr and/or --remote-time options enabled (e.g. via .curlrc or a curl alias), the warnings below may (remote time only when the server returns a Last-Modified: header) appear on stderr, respectively:

Warning: Error setting extended attributes: Operation not permitted
Failed to set filetime <unixtime> on outfile: Operation not permitted

Example (for *nix platforms):

$ curl --xattr --remote-time --output /dev/null https://example.org/ --write-out '%{content_type}'`

Actual console output:

Warning: Error setting extended attributes: Operation not permitted
Failed to set filetime <unixtime> on outfile: Operation not permitted
text/html; charset=UTF-8

Expected console output:

text/html; charset=UTF-8

An inconvenience rather than a bug per se, yet I think it'd be an improvement to try mitigating this, either by suppressing the warning when a non-file output is used, or by bringing --remote-time behavior closer to --xattr and omit the warning if the --silent option is used.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions