file input/output for array