Try to open the file before use data from stat.