goodfile

sofia_redux.toolkit.utilities.func.goodfile(filename, read=True, write=False, execute=False, verbose=False)[source]

Check if a file exists, and optionally if it has the correct permissions.

Parameters:
filenamestr

path to a file

readbool, optional

check if the file can be read

writebool, optional

check if a file has write permission

executebool, optional

check if a file has execute permission

verbosebool, optional

If True output log messages

Returns:
bool

True if the file exists and fulfills all requirements, False otherwise.