shapepipe.utilities.file_system

shapepipe.utilities.file_system

FILE SYSTEM TOOLS.

This module defines methods for managing actions on the file system.

Author

Samuel Farrens <samuel.farrens@cea.fr>

exception FileSystemError[source]

Bases: Exception

File System Error.

Generic error that is raised by the file system.

check_dir(dir_name)[source]

Check Directory.

Check if directory exists.

Parameters

dir_name (str) – Directory name

Raises

TypeError – If directory name is not a string

mkdir(dir_name, check_created=True, exist_ok=True)[source]

Make Directory.

This method creates a directory in the specified path.

Parameters
  • dir_name (str) – Directory name with full path

  • check_created (bool) – Check if directory is properly created or already exists, raise error if not found (default is True)

  • exist_ok (bool) – If False raise an error if the directory alredy exists (default is True)

Raises