ENOTDIR translation is funny
Jan Hudec
bulb at ucw.cz
Sat Jan 21 07:44:10 GMT 2006
On Fri, Jan 20, 2006 at 15:37:28 -0500, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Collins wrote:
> > On Fri, 2006-01-20 at 10:00 -0800, Robey Pointer wrote:
> >
> >>It may be because sftp servers tend to translate ENOTDIR to
> >>SFTP_NO_SUCH_FILE. (SFTP only has 4 real error codes.) As I guess
> >>people are sick of hearing me say: We can't really depend on good
> >>error fidelity from transports, so we shouldn't put too much weight
> >>on fine-grained error codes. I think HTTP can barely do better than
> >>"it succeeded" vs "it failed".
> >
> >
> > Hmm, could be. I was just a little worried about confusion when someone
> > issues a local 'transport.delete('a_directory')' and recieves
> > 'NoSuchFile' as the error.
>
> While a uniform interface is important, perhaps we can fix this by
> adding more contextual smarts to the SFTP transport. For example,
> putting files could translate SFTP_NO_SUCH_FILE to NotADirectory, while
> reading files would translate SFTP_NO_SUCH_FILE to NoSuchFile.
The problem is, that that is not true. When putting files, SFTP_NO_SUCH_FILE
is still more often NoSuchFile than a NotADirectory. NotADirectory only
occurs if the parent name exists, but is not a directory, while when it does
not exist at all, it is still NoSuchFile.
--
Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060121/f5275722/attachment.pgp
More information about the bazaar
mailing list