devctrl.utility.file_io#

Functions

add_zeros

return v as string, add leading zeros if len(str(v)) < digits

get_date_for_filename

Current date formated as YYYY-mm-dd

get_date_time_for_filename

Current date and time formated as YYYY-mm-dd_HH-MM

get_next_filename

If the filepath does not exist, returns the filepath.

get_next_filename_with_number

Get the next filename (without extenstion).

listdir_abs

Version of os.listdir that returns absolute paths and is sorted by name :param base_dir: :return:

listdir_filter

Return absolute paths of directories in base_dir that match the filter_regex

prepend_date

Prepend the date in ISO format if name does not start with a date.

prepend_date_time

Prepend the date and time in ISO format if name does not start with a date.

sanitize_filename

Remove invalid characters from filename.

search_in_path

Search for a file or directory called <name> in the current working directory and sys.path