Closed j0hnsmith closed 10 years ago
You can try do a AND-bitmask the SharedFile.file_attributes with the value of 0x00001000.
See http://msdn.microsoft.com/en-us/library/cc246322.aspx The ATTR_OFFLINE constant is a new extension to the SMB specs (I have not added them to pysmb yet).
Thanks for your comments. Calling listPath
and processing the results is inefficient for my use case as I want the details for a single file, not an entire directory. Is there a way I can make a QUERY_INFO request (2.2.37 http://msdn.microsoft.com/en-us/library/cc246557.aspx) for a specific file directly?
I would concur. I wrote a method to grab the entire path listing then parse for the particular file (if requested): https://github.com/smartfile/fs-smb/blob/master/smbfs/__init__.py#L181
I tried other tricks to use a pattern or such, but I was unable to figure out a way that always worked using those tricks.
@scfarley , @j0hnsmith : I guess it's about time to improve the current API to add in this functionality. I will do about it over this weekend. Will keep both of you posted via github.
@miketeo did you manage to add this functionality?
@j0hnsmith : Yes, it was released in pysmb 1.1.10
Ahh yes, I missed https://github.com/miketeo/pysmb/commit/fdd3bdc248d862faee564d483c117e8f380b854c. Many thanks
Thank you very much.
SMBConnection is cool but I don't see a way to get the metadata for a file, specifically I'd like to be able to get 'offline' attribute for a file. How can I get that attribute for a file using this library?