added support for file glob pattern argument, writing file to disk