pic_scanner.helpers.filesystem.attributes

Functions

file_has_recall_attribute(→ bool)

Check if a file has the 'recall on data access' attribute set.

Module Contents

pic_scanner.helpers.filesystem.attributes.file_has_recall_attribute(file_path: str | pathlib.Path, do_not_provision: bool = False) bool

Check if a file has the ‘recall on data access’ attribute set.

This function checks if a file has the ‘recall on data access’ attribute set. This attribute is used by Windows to mark files that should be recalled from a storage device when they are accessed. OneDrive uses this attribute to mark files that are stored in the cloud and not stored locally. This function will return True if the file has the attribute set, and False if it does not. This can be useful for finding out which files must be downloaded from the cloud before they can have operations performed on them.

Note

This function is only available on Windows.

Parameters:
  • file_path (Union[str, Path]) – The path to the file to check.

  • do_not_provision (bool) – Whether to provision the path before checking it.

Returns:

True if the file has the ‘recall on data access’ attribute set, False otherwise.

Return type:

bool