[Libssh] sftp - determining directory item types

Mike Taylor mike at codeshorts.ca
Thu May 15 18:47:25 CEST 2008


Thanks!  I should be able to use the macros from stat if the field is  
posix compliant.

/\/\ike

On 15-May-08, at 12:26 PM, Aris Adamantiadis wrote:

> Hello,
>
> Re-reading the drafts, it looks like the type of file is included into
> the permission field :
>
>    The `permissions' field contains a bit mask of file permissions as
>    defined by posix [1].
>
> also, the diffs from v3 to v4 says
>
>    o  Split the file type out of the permissions field and into it's  
> own
>       field (which is always present.)
>
> So, you have to find that information into the bitmask permissions.
>
> Regards,
> Aris
> Mike Taylor a écrit :
>> Hi Aris,
>>
>> I don't see a function to get the sftp version, however the
>> SFTP_SESSION structure's server_version member is set to 3.  Also,
>> I've traced the code though the sftp_parse_attr_3 function.
>>
>> Cheers!
>>
>> /\/\ike
>>
>> On 15-May-08, at 9:49 AM, Aris Adamantiadis wrote:
>>> Hello,
>>>
>>> I wouldn't trust the first character. The SFTP_ATTRIBUTE structure  
>>> is
>>> badly designed because the sftp draft completely changed it at every
>>> version. So, to answer correctly your question i'd need the  
>>> version of
>>> the sftp protocol your server is speaking. (I think there is a  
>>> libssh
>>> function to tell that).
>>>
>>> Regards,
>>> Aris
>>
>>
>>
>>
>> _______________________________________________
>> Libssh mailing list
>> Libssh at cerkinfo.be
>> http://www.cerkinfo.be/cgi-bin/mailman/listinfo/libssh
>
>
> _______________________________________________
> Libssh mailing list
> Libssh at cerkinfo.be
> http://www.cerkinfo.be/cgi-bin/mailman/listinfo/libssh




More information about the Libssh mailing list