lsdosattr(1) General Commands Manual lsdosattr(1)

lsdosattr - list DOS file attributes

lsdosattr [ -RadlVh ] [ FILES... ]

lsdosattr lists the DOS attributes, size and VDL(valid data length) of files. The DOS attributes are

r (READONLY)
h (HIDDEN)
s (SYSTEM)
v (VOLUME)
s (DIRECTORY)
a (ARCHIVED)

Each file is shown in 4 columns that represent the attributes, size, VDL of the file. When the option -l is used, the columns are shown in the order of file name, size, VDL and long attributes.

List subdirectories recursively
Do not ignore entries starting with a dot('.')
List directories themselves, not their contents
Use long attribute names instead of single character abbreviations
Show version
Show help

0
on success
1
when no file could be listed
2
on usage error
3
when an error occurred but at least one file was successfully listed

Linux kernel does not provide a special interface for reading the VDL(valid data length). If the in-kernel exFAT implementation is "VDL-aware", the VDL offset is treated as the start of the "hole"(SEEK_HOLE) that ranges to EOF. Therefore, the approximate VDL can be inferred from lseek(2) and this is why lsdosattr merely prints the first hole it encounters as the VDL.

In vFAT, exFAT and NTFS, only the READONLY attribute is controlled through owner write permission bit. Linux kernel always sets ARCHIVE on files it creates and modifies. HIDDEN and SYSTEM can only be controlled through ioctl_fat(2). lsdosattr(1) and chdosattr(1) are the wrappers for the ioctl.

lsattr(1), ioctl_fat(2) and the documentation on ATTRIB command in Microsoft Windows and various DOS.