If the file is directory do not get its name without extension