better handling of file extensions in split_file