batch write files