if the directory does not exist and needs to be created, this will fail as ``realpath`` will return ``false``