Dealing with two possible file/directory formats