yes that would work, but you may want to use the @ operator to surpress errors that [man]fopen[/man] will generate if it cannot open the file (depending on your error reporting settings).
also be advise the [man]fopen[/man] returns false anyway if the file cannot be opened so you could do:
$file = @fopen("/logs/$filename", 'a+');
$erro = $file;