1

I have this (partial) main JS code:

Cu.import("resource://gre/modules/osfile.jsm");
[...]
// if it is a Win environment put the attrib file to hidden
OS.File.setPermission(
        OS.Path.join(OS.Constants.Path.homeDir,  'my_file.txt'),
            {
                winAttributes: {
                    hidden: true
                }
            }
).then(x => console.log('success',x), y => console.log('failure',y));

I am testing it on Linux, and when the execution reaches the promise indicated above, it is reported this error:

console.log: TypeError: OS.File.setPermission is not a function

I suppose this effect also indicates that the execution of that part on an add-on target Windows platform is compromised, isn't it?

Why does it happen? Where am I wrong? Thanks.

Here the reference for setPermission

Bento
  • 223
  • 1
  • 12
  • 1
    Sorry for this post: The question is very trivial because it is a matter of distraction, that is, the absence of the 's' in 'Permission' – Bento Apr 14 '16 at 07:02
  • So you solved the prblem? :) `OS.File.setPermissions` haha tricky typo it happens – Noitidart Apr 29 '16 at 17:27

0 Answers0