Add support for file mode