BarecatDirInfo#

class barecat.BarecatDirInfo(path=None, mode=None, uid=None, gid=None, mtime_ns=None, num_subdirs=None, num_files=None, size_tree=None, num_files_tree=None)#

Bases: barecat.BarecatEntryInfo

Describes directory information such as path, metadata and statistics.

This class is used both when retrieving existing directory information and when adding new directories.

Parameters:
  • path (Optional[str]) – path to the directory inside the archive

  • mode (Optional[int]) – directory mode, i.e., permissions

  • uid (Optional[int]) – user ID

  • gid (Optional[int]) – group ID

  • mtime_ns (Optional[Union[int, datetime]]) – last modification time in nanoseconds since the Unix epoch

  • num_subdirs (Optional[bool]) – number of subdirectories in the directory

  • num_files (Optional[int]) – number of files in the directory

  • size_tree (Optional[int]) – total size of the directory contents in bytes

  • num_files_tree (Optional[int]) – total number of files in the directory and its subdirectories

Properties#

num_entries

Total number of entries in the directory, including subdirectories and files.

Methods#

asdict()

Returns a dictionary representation of the directory information.

fill_from_statresult(s)

Fills the directory metadata information from a stat result, from the file system.