if your file/folder does not exist `realpath` returns `false` so my comment was not that wrong (and also you can not process a file/folder which does not exist). But pick what you think is best, that will be ok.