Facades can often be found in Python's source code.
isdir function found in the
os.path module serves as a Facade outshining work
os.stat modules. Internally
isdir calls the
os.stat function and that function in turn calls the
stat() system call on the given path. This system call returns a structure with members, namely:
st_mode: This indicates some protection bits
st_size: This is the size of the file, in bytes
st_atime: This is the time of the most recent access
stat.S_ISDIR internally applies a bit mask
S_IFMT to detect if the file passed by is actually a directory. This looks pretty confusing, but the good news is that the end user of this function does not need to know these intricacies. The ...