utils.windows.files module

Windows file and file-listing utilities

utils.windows.files.childitem_to_table(text: str) List[Dict]

Given a Get-ChildItem call output for director(ies), converts to a table

Table is returned in the format suitable for table_to_string, a list of dictionaries. Each dictionary has the keys:

  • mode (file permissions)

  • write-date (last date file was modified)

  • write-time (last time file was modified)

  • size (file size, 0 for directories)

  • path (parent directory path)

  • name (item file name)

utils.windows.files.simplify_file_childitem(text: str, show_size: bool = False, show_date: bool = False)

Simplifies a list of Get-ChildItem calls

Takes standard get-childitem format and changes it into a table