can paramiko sftp stat return 'nlinks'?

Robey Pointer robey at lag.net
Tue Aug 8 03:34:51 BST 2006


On 7 Aug 2006, at 16:51, John Arbash Meinel wrote:

> I was thinking about working on 'break hardlinks on write'. Which  
> would
> let us support hard-linked knit repositories. Basically, before we
> append to a knit we stat it to see if it has more than 1 hardlink, and
> if it does, we copy the data, and then do an append. This could get
> expensive over sftp, since it doesn't have a remote copy command.  
> And I
> don't think 'ftp' would support it (all we get from ftp.stat() is the
> file size).
>
> So I'm just wondering if it is possible for stat over sftp to  
> return the
> number of links or not.

Bad news, I'm afraid.  It's in the v6 protocol spec (a way to get the  
link count as part of a stat), but in the real world no server  
implements more than v3.

robey





More information about the bazaar mailing list