Use stat properly (you don't want to open directories or devices...)