handle file type in sprintf