error check, and TRUNC behavior for do_open