This was originally after stripping the potential filename, otherwise you'll get an unwanted directory named after the file.