in reply to Is this code logical?

Failing to check the return value of open() is pretty illogical.