pyiron_base.utils.safetar.is_within_directory

pyiron_base.utils.safetar.is_within_directory#

pyiron_base.utils.safetar.is_within_directory(directory: str, target: str) bool[source]#

Check if the target path is within the specified directory.

Parameters:
  • directory (str) – The directory path.

  • target (str) – The target path.

Returns:

True if the target path is within the directory, False otherwise.

Return type:

bool