Seems like a library interface that isn't well thought through: Accepting a number as input, but it's only reasonably written in one base. Then it's not really a number, but rather a formatted string, so the chmod function should take a string as argument and do its own parseInt(_,8) on it (and accept other formats too, like "a+rw" or "rwxr--r--").
Don't try to fix a single broken interface by adding unnecessary features to the language! /L 'not a Unix hater, but probably a chmod hater' On Thu, Jan 12, 2012 at 8:51 PM, Wes Garland <[email protected]> wrote: > I'll chime in with my vote - I would LOVE to be able to use octal literals > again in GPSEE for setting file permissions. > > chmod("filename", parseInt("777", 8)) > > ^^^^ just looks stupid when chmod("filename", 0777) would work just fine. > > Wes > > > > On 12 January 2012 14:11, Brendan Eich <[email protected]> wrote: >> >> [Resending reply with elaboration. /be] >> >> Yes, the ability to quote the octal literal with Node's APIs came up on >> the gist, but it's not enough. >> >> Quoting is easy to forget, and making the runtime convert string (literal) >> to number is inefficient compared to having JS do it at compile-time, and >> making the runtime (even via a call to parseInt) do it also increases bug >> habitat ever so slightly. >> >> Mainly, users don't have to shun octal in non-strict mode, and they do not >> in Node code I have seen. They won't be adopting strict mode as far as I can >> tell. Banning octal is just one more reason for those who *might* adopt >> strict mode to reject it. >> >> Agree on parseInt. Old dog, hard to change (runtime-only errors are >> migration- and user-hostile). Not sure what to do there. >> >> >> /be >> >> _______________________________________________ >> es-discuss mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/es-discuss > > > > > -- > Wesley W. Garland > Director, Product Development > PageMail, Inc. > +1 613 542 2787 x 102 > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

