Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Filename too long - Warning: Failed to create the file #2174
I did this
curl -O -J
I expected the following
If curl cannot create file because name is too long than I expect file with trimmed name to be created.
curl 7.56.1 (x86_64-pc-linux-gnu) libcurl/7.56.1
4.13.12-1-ARCH x86_64 GNU/Linux
I agree with @jay.
If possible, the error message could be clearer.
Shortened? Not really, full output:
error code = 23
I'm using curl as a download tool for custom webkit-based browser (surf).
Option -J is necessary to have proper filenames for downloadable *zip, *pdf, etc. On the other hand I could trim filename by myself (in surf c code), but in such case I loose -J Content-Disposition filename because -o is apparently superior to -J.
So other expected solution would be:
but to make -o "my-filename" work only if Content-Disposition is not in the headers.
Aaah, the warning message itself is truncated as it only uses a 256 bytes buffer so the error message after the file name isn't visible! I'll start out by fixing that... (commit 5d0ba70)
Yes, -J only works with -O. I suppose it could be expanded to also work with
So really, with a >255 bytes long part to the right of the rightmost slash,