octal literals and octal escape sequences are deprecated

4 views
Skip to first unread message

Christoph Dorn

unread,
Sep 20, 2011, 3:09:48 PM9/20/11
to gp...@googlegroups.com
I am getting the following message:

JS warning #232 in loader.js at line 355 ch 76 - octal literals and
octal escape sequences are deprecated

Source:

[355]
API.FILE.mkdirs(API.FILE.dirname(cliOptions["link-program-to"]), 0775);

How should I write the mode so it is compatible with all JS engines?

Thanks!
Christoph

Jeff Johnson

unread,
Sep 20, 2011, 3:14:49 PM9/20/11
to gp...@googlegroups.com

You are likely doomed to decimal if you want portability:

eastham:gpsee jbj$ dc
8 i
0775 p
509

i.e. 0775 in octal == 509 in decimal

There are coercion functions in the Math module if you wish the octal
(because its more readable). The leading zero indicating octal implicitly
is what isn't portable.

73 de Jeff

> Thanks!
> Christoph
>

Wes Garland

unread,
Sep 20, 2011, 4:03:30 PM9/20/11
to gp...@googlegroups.com
sadly, I have been using parseInt("0755") in modules/fs-base.js.

Hideous, but functional.

Note, FWIW, that the fs-base module uses a bit-breaking object, like so:

{ group: { read: true, write: true }}

or similar.  Memory is a little fuzzy here, and ISTR that there may be a bug lurking in umask(2) processing as well. Ping if you find this.

Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
Reply all
Reply to author
Forward
0 new messages