dctools.utilities.file_utils

Functions for file handling.

Functions

check_valid_files(list_files)

Check if files in a list exist and return the valid ones.

delete_files_from_list(directory, list_files)

Remove a list of files in a given directory.

empty_folder(dir_name[, extension])

Remove all files in given folder.

get_list_filter_files(directory, extension, ...)

Return a list of files that match some conditions.

list_files_with_extension(directory, extension)

Return a list of all files with a given extension in a specified directory.

load_config_file(path)

Load a YAML configuration file.

read_file_tolist(filepath[, max_lines])

Read a file and return its content as a list of strings (lines).

remove_file(filepath)

Remove a local file.

remove_listof_files(list_files, dir)

Remove a list of files from a given folder.

run_command(command)

Run and wait till the end of the given command.

Classes

FileCacheManager(max_files)

Manages a cache of files with automatic cleanup when limit is reached.