added file mode for scala