SFTP w/ proper atomic put and locking

John A Meinel john at arbash-meinel.com
Sun Nov 13 19:01:23 GMT 2005


Robert Collins wrote:
> On Fri, 2005-11-11 at 18:57 -0800, Robey Pointer wrote:
> 
>> Well, you've definitely convinced me that paramiko's SFTPClient.file 
>> () should have some kind of file-flag translation for O_EXCL. :)  I  
>> picked 'x' (someone please shout out if this is a bad choice) and it  
>> should be in 1.5.2 or whatever the next version turns out to be.  I  
>> promise not to break your version any time soon. :)
> 
> 'x' ?  Why not just 'O_EXCL' as already defined in python ?
> 
> Rob
> 

Well, paramiko's file() acts like pythons file(), which takes the "wb"
flags, not O_CREAT | O_TRUNC, etc.
I think he was trying to find a way to do it inside the same text
string. Though I think it might actually work better to have another
field for "extra_flags" or something like that.

John
=:->

PS> os.open() opens a direct file number handle, so it does take
O_CREAT, etc, but the default python file open is more like fopen()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051113/2998a9d7/attachment.pgp 


More information about the bazaar mailing list