Samba и хранение DOS attributes в ea
Nov. 16th, 2011 09:49 pmПри "store dos attributes = yes" samba хранит DOS-атрибуты файлов:
Bit 0 Read-Only
Bit 1 Hidden
Bit 2 System
Bit 3 Volume Label
Bit 4 Directory
Bit 5 Archive
в extended attributes UFS в псевдо-hex виде, а на самом деле в виде строк:
$ getextattr user DOSATTRIB file.txt
file.txt 0x20
$ getextattr -x user DOSATTRIB file.txt
file.txt 30 78 32 30
Сбросить все атрибуты
$ setextattr user DOSATTRIB 0x0 file.txt
Bit 0 Read-Only
Bit 1 Hidden
Bit 2 System
Bit 3 Volume Label
Bit 4 Directory
Bit 5 Archive
в extended attributes UFS в псевдо-hex виде, а на самом деле в виде строк:
$ getextattr user DOSATTRIB file.txt
file.txt 0x20
$ getextattr -x user DOSATTRIB file.txt
file.txt 30 78 32 30
Сбросить все атрибуты
$ setextattr user DOSATTRIB 0x0 file.txt