Function check can read-write files and get failure