[Samba] How do i get file attributes using samba.

Jeremy Allison jra at samba.org
Mon Jun 20 15:49:01 MDT 2011


On Mon, Jun 20, 2011 at 12:58:07AM -0700, naga_kishore_kommuri at yahoo.com wrote:
> Hi,
> I need to extract the following attributes of a file in Windows share using samba.
> 
> /* FileAttributesField */
> #define FILE_ATTRIBUTE_READONLY         0x001L
> #define FILE_ATTRIBUTE_HIDDEN           0x002L
> #define FILE_ATTRIBUTE_SYSTEM           0x004L
> #define FILE_ATTRIBUTE_DIRECTORY        0x010L
> #define FILE_ATTRIBUTE_ARCHIVE          0x020L
> #define FILE_ATTRIBUTE_NORMAL           0x080L
> #define FILE_ATTRIBUTE_TEMPORARY        0x100L
> #define FILE_ATTRIBUTE_SPARSE           0x200L
> #define FILE_ATTRIBUTE_REPARSE_POINT    0x400L
> #define FILE_ATTRIBUTE_COMPRESSED       0x800L
> #define FILE_ATTRIBUTE_OFFLINE          0x1000L
> #define FILE_ATTRIBUTE_NONINDEXED       0x2000L
> #define FILE_ATTRIBUTE_ENCRYPTED        0x4000L
> #define SAMBA_ATTRIBUTES_MASK           0x7F
> 
> 
> Which API of samba library should I use to extract these attributes of a file.

If you're using libsmbclient, you need to use
SMBC_getxattr() or SMBC_getxattr_ctx() asking
for "system.dos_attr.mode".

Jeremy.


More information about the samba mailing list