if (! -w $file $user) { #do permission-ey things to fix that }