problem with fwrite

hi guys, i'm having problem with @fwrite return
sometimes don't return false and the "if (!$written)" isn't 'converted' to true, please change to "if ($written===false)"