Make sure file exists before stat

ticket:	#2329