Add support for batch write for file mode