moving file type judgement to fs.py