Fix #59 add file mode to examples