filesystem.listdir¶
Get the contents of a directory.
The select option may be used to optimize listdir performance. Metadata-related fields that are not selected will not be retrieved from the filesystem.
For example {“select”: [“path”, “type”]} will avoid querying an xattr list and ZFS attributes for files in a directory.
NOTE: an empty list for select (default) is treated as requesting all information.
Each entry of the list consists of: name(str): name of the file path(str): absolute path of the entry realpath(str): absolute real path of the entry (if SYMLINK) type(str): DIRECTORY | FILE | SYMLINK | OTHER size(int): size of the entry allocation_size(int): on-disk size of entry mode(int): file mode/permission uid(int): user id of entry owner gid(int): group id of entry owner acl(bool): extended ACL is present on file is_mountpoint(bool): path is a mountpoint is_ctldir(bool): path is within special .zfs directory attributes(list): list of statx file attributes that apply to the file. See statx(2) manpage for more details. xattrs(list): list of extended attribute names. zfs_attrs(list): list of ZFS file attributes on file
No Additional Items
Tuple Validation
Parameter 1: path
path
Type: stringMust be at least 1
characters long
Parameter 2: query_filters
query_filters
Type: array Default: []No Additional Items
Each item of this array must be:
Parameter 3: query_options
query_options
Type: objectNo Additional Properties
Relationships
Type: boolean Default: trueExtend
Default: nullExtend Context
Default: nullPrefix
Default: nullExtra
Type: object Default: {}Order By
Type: array of string Default: []No Additional Items
Each item of this array must be:
Select
Type: array Default: []No Additional Items
Each item of this array must be:
No Additional Items
Each item of this array must be:
Count
Type: boolean Default: falseGet
Type: boolean Default: falseOffset
Type: integer Default: 0Limit
Type: integer Default: 0Force Sql Filters
Type: boolean Default: falseResult
No Additional Items
Each item of this array must be:
FilesystemDirQueryResultItem
Type: objectNo Additional Properties
Name
Type: stringEntry's base name.
Must be at least 1
characters long
Path
Type: stringEntry's full path.
Must be at least 1
characters long
Realpath
Type: stringCanonical path of the entry, eliminating any symbolic links
Must be at least 1
characters long
Type
Type: enum (of string)Must be one of:
- "DIRECTORY"
- "FILE"
- "SYMLINK"
- "OTHER"
Size
Type: integerSize in bytes of a plain file. This corresonds with stx_size.
Allocation Size
Type: integerAllocated size of file. Calculated by multiplying stx_blocks by 512.
Mode
Type: integerEntry's mode including file type information and file permission bits. This corresponds with stx_mode.
Mount Id
Type: integerThe mount ID of the mount containing the entry. This corresponds to the number in first
field of /proc/self/mountinfo and stxmntid.
Acl
Type: booleanSpecifies whether ACL is present on the entry. If this is the case then file permission
bits as reported in mode
may not be representative of the actual permissions.
Uid
Type: integerUser ID of the entry's owner. This corresponds with stx_uid.
Gid
Type: integerGroup ID of the entry's owner. This corresponds with stx_gid.
Is Mountpoint
Type: booleanSpecifies whether the entry is also the mountpoint of a filesystem.
Is Ctldir
Type: booleanSpecifies whether the entry is located within the ZFS ctldir (for example a snapshot).
Attributes
Type: array of enum (of string)Extra file attribute indicators for entry as returned by statx. Expanded from stx_attributes.
No Additional ItemsEach item of this array must be:
Must be one of:
- "COMPRESSED"
- "APPEND"
- "NODUMP"
- "IMMUTABLE"
- "AUTOMOUNT"
- "MOUNT_ROOT"
- "VERIFY"
- "DAX"
Xattrs
Type: array of stringList of xattr names of extended attributes on file.
No Additional ItemsEach item of this array must be:
Must be at least 1
characters long
Zfs Attrs
List of extra ZFS-related file attribute indicators on file. Will be None type if filesystem is not ZFS.
No Additional Items
Each item of this array must be:
Must be one of:
- "READONLY"
- "HIDDEN"
- "SYSTEM"
- "ARCHIVE"
- "IMMUTABLE"
- "NOUNLINK"
- "APPENDONLY"
- "NODUMP"
- "OPAQUE"
- "AV_QUARANTINED"
- "AV_MODIFIED"
- "REPARSE"
- "OFFLINE"
- "SPARSE"
FilesystemDirQueryResultItem
Type: objectNo Additional Properties
Name
Type: stringEntry's base name.
Must be at least 1
characters long
Path
Type: stringEntry's full path.
Must be at least 1
characters long
Realpath
Type: stringCanonical path of the entry, eliminating any symbolic links
Must be at least 1
characters long
Type
Type: enum (of string)Must be one of:
- "DIRECTORY"
- "FILE"
- "SYMLINK"
- "OTHER"
Size
Type: integerSize in bytes of a plain file. This corresonds with stx_size.
Allocation Size
Type: integerAllocated size of file. Calculated by multiplying stx_blocks by 512.
Mode
Type: integerEntry's mode including file type information and file permission bits. This corresponds with stx_mode.
Mount Id
Type: integerThe mount ID of the mount containing the entry. This corresponds to the number in first
field of /proc/self/mountinfo and stxmntid.
Acl
Type: booleanSpecifies whether ACL is present on the entry. If this is the case then file permission
bits as reported in mode
may not be representative of the actual permissions.
Uid
Type: integerUser ID of the entry's owner. This corresponds with stx_uid.
Gid
Type: integerGroup ID of the entry's owner. This corresponds with stx_gid.
Is Mountpoint
Type: booleanSpecifies whether the entry is also the mountpoint of a filesystem.
Is Ctldir
Type: booleanSpecifies whether the entry is located within the ZFS ctldir (for example a snapshot).
Attributes
Type: array of enum (of string)Extra file attribute indicators for entry as returned by statx. Expanded from stx_attributes.
No Additional ItemsEach item of this array must be:
Must be one of:
- "COMPRESSED"
- "APPEND"
- "NODUMP"
- "IMMUTABLE"
- "AUTOMOUNT"
- "MOUNT_ROOT"
- "VERIFY"
- "DAX"
Xattrs
Type: array of stringList of xattr names of extended attributes on file.
No Additional ItemsEach item of this array must be:
Must be at least 1
characters long
Zfs Attrs
List of extra ZFS-related file attribute indicators on file. Will be None type if filesystem is not ZFS.
No Additional Items
Each item of this array must be:
Must be one of:
- "READONLY"
- "HIDDEN"
- "SYSTEM"
- "ARCHIVE"
- "IMMUTABLE"
- "NOUNLINK"
- "APPENDONLY"
- "NODUMP"
- "OPAQUE"
- "AV_QUARANTINED"
- "AV_MODIFIED"
- "REPARSE"
- "OFFLINE"
- "SPARSE"
Required roles: FILESYSTEM_ATTRS_READ