cURL / Mailing Lists / curl-users / Single Mail

curl-users

[Bug #122381] -C - on upload failed if file does not exist (fwd)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 14 Nov 2000 09:05:13 +0100 (MET)

Hi fellows

I think this is an interesting topic, so I forward this bug report to all of
you. What would you say is the correct behaviour?

Should curl take every attempt to fulfill a command or is it sometimes useful
that it fails?

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
---------- Forwarded message ----------
Subject: [Bug #122381] -C - on upload failed if file does not exist
Details: curl 7.4.1 (i686-pc-linux-gnu) libcurl 7.4.1 (SSL 0.9.5)
When uploading a file with '-C -' option, the upload failed if the file does
not exit. This is because the SIZE command failed.
I think a more natural behaviour is to assume a size of zero and upload
the whole file.
> TYPE I
< 200 Type set to I.
> SIZE webalizer.conf
< 550 webalizer.conf: not a plain file.
curl: (32) Couldn't get file size: webalizer.conf: not a plain file.
Follow-Ups:
Date: 2000-Nov-14 00:01
By: bagder
Comment:
I think this question leaves a few ends that need attention before I run ahead and just implement a fix.
1. Is it always just uploading the file that is desired? If I remove the error condition, no script or user is likely to discover that it isn't an append that takes place but a plain upload. Perhaps a failure and a modified command line to do the upload is sometimes preferred?
2. How does curl know that file is truly missing? The 550 return code as described below may not only be used for 'missing file' error conditions. We have this problem with 'SIZE' as it isn't defined in RFC959 so there is of course doubts on how to use it and what replies to expect. The internet draft draft-ietf-ftpext-mlst-12.txt (http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-12.txt) defines the error code 550 after a SIZE:
"The presence of the 550 error response to a SIZE command MUST NOT be taken by the client as an indication that the file can not be transferred in the current MODE and TYPE.  A server may generate this error for other reasons -- for instance if the processing overhead is considered too great."
-------------------------------------------------------
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=122381&group_id=976
Received on 2000-11-14