datalad_next.iter_collections.utils
Utilities and types for collection iterators
- class datalad_next.iter_collections.utils.FileSystemItem(type: 'FileSystemItemType', name: 'PurePath', size: 'int', mtime: 'float | None' = None, mode: 'int | None' = None, uid: 'int | None' = None, gid: 'int | None' = None, link_target: 'PurePath | None' = None, fp: 'IO | None' = None)[source]
Bases:
PathBasedItem
,TypedItem
- fp: IO | None = None
- classmethod from_path(path: Path, *, link_target: bool = True)[source]
Populate item properties from a single stat and readlink call
The given
path
must exist. Thelink_target
flag indicates whether to report the result ofreadlink
for a symlink-type path.
- gid: int | None = None
- link_target: pathlib.PurePath | None = None
- mode: int | None = None
- mtime: float | None = None
- size: int
- type: FileSystemItemType
- uid: int | None = None
- class datalad_next.iter_collections.utils.FileSystemItemType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
Enumeration of file system path types
The associated
str
values are chosen to be appropriate for downstream use (e.g, as type labels in DataLad result records).- directory = 'directory'
- file = 'file'
- hardlink = 'hardlink'
- specialfile = 'specialfile'
- symlink = 'symlink'