Mozillas tutorial site explains that, in order to use the module, you have to put Components.utils.import("resource://gre/modules/osfile.jsm") at the
Components.utils.import("resource://gre/modules/osfile.jsm")