ENOTDIR translation is funny

Aaron Bentley aaron.bentley at utoronto.ca
Fri Jan 20 20:37:28 GMT 2006


-----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.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD0UoI0F+nu1YWqI0RAmXYAKCDbbcOirS+S144FYUPp/+h5kXzhACdEUhq
rljxH/zBpvAtubHGz5/cQ+o=
=7Gjq
-----END PGP SIGNATURE-----




More information about the bazaar mailing list