One option to make file_isdir work