fix bug on concatFiles: open with write(create) mode.