Skip to main content

prefect.utilities.filesystem

Utilities for working with file systems

Functions

create_default_ignore_file

Creates default ignore file in the provided path if one does not already exist; returns boolean specifying whether a file was created.

filter_files

This function accepts a root directory path and a list of file patterns to ignore, and returns a list of files that excludes those that should be ignored. The specification matches that of .gitignore files.

tmpchdir

Change current-working directories for the duration of the context, with special handling for UNC paths on Windows.

filename

Extract the file name from a path with remote file system support

is_local_path

Check if the given path points to a local or remote file system

to_display_path

Convert a path to a displayable path. The absolute path or relative path to the current (or given) directory will be returned, whichever is shorter.

relative_path_to_current_platform

Converts a relative path generated on any platform to a relative path for the current platform.

get_open_file_limit

Get the maximum number of open files allowed for the current process