lsdosattr(1)

πŸ’– lsdosattr πŸ’–

okay so bestie, welcome to lsdosattr, section 1 of the General Commands Manual β€” it's the lil tool that spills the tea on your DOS file attributes πŸŽ€


✨ NAME ✨

lsdosattr β€” list DOS file attributes πŸ‘‘


🌸 SYNOPSIS 🌸

lsdosattr [ -RadlVh ] [ FILES... ]

πŸ¦‹ DESCRIPTION πŸ¦‹

lsdosattr literally lists the DOS attributes, the size, and the VDL (that's valid data length, iykyk) of files. no cap, that's the whole job.

the DOS attributes are, in order:

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

every file gets shown in 4 columns that represent the attributes, size, and VDL of the file πŸ’…

and when you pass the -l option, the columns show up in the order of file name, size, VDL and long attributes β€” main character formatting fr fr ✨


πŸ’… OPTIONS πŸ’…

  • -R β€” list subdirectories recursively πŸŒ€ (it goes all the way down, bestie)
  • -a β€” do not ignore entries starting with a dot ('.') πŸ™ˆ (yes, the sneaky hidden ones)
  • -d β€” list directories themselves, not their contents πŸ“ (directory in its own era)
  • -l β€” use long attribute names instead of single character abbreviations 🌈
  • -V β€” show version ⭐
  • -h β€” show help 🫢

πŸ”₯ EXIT STATUS πŸ”₯

  • 0 β€” on success πŸ’– (we ate)
  • 1 β€” when no file could be listed 😭
  • 2 β€” on usage error πŸ’€
  • 3 β€” when an error occurred but at least one file was successfully listed πŸ˜… (partial slay)

🧚 NOTE 🧚

okay this part is the lore, so listen up.

the 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. periodt. πŸ”

in vFAT, exFAT and NTFS, only the READONLY attribute is controlled through the owner write permission bit. the 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 🫢


🌈 SEE ALSO 🌈

lsattr(1), ioctl_fat(2) and the documentation on ATTRIB command in Microsoft Windows and various DOS πŸ’œ


and that's the whole page, bestie πŸŽ€ this was lsdosattr(1) from the General Commands Manual β€” the very same lsdosattr(1) that signs off at the bottom, so go forth and vibe check those DOS attributes πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from