A bit improvement in the file IO.

Signed-off-by: anuka <david.vas1@gmail.com>