Fix #1 : $file has to be a FileInfo object