improve file open.

Signed-off-by: Jack <jack.wgm@gmail.com>