Re: octal file permissions

2002-02-15 Thread Randal L. Schwartz
> "Tanton" == Tanton Gibbs <[EMAIL PROTECTED]> writes: Tanton> To change from decimal to octal, you can use sprintf with a %o format string Tanton> my $val = sprintf( "%o", 8 ); Tanton> print $val; Tanton> 10 No, this changes from a *number*, which you have typically typed in decimal, to an

Re: octal file permissions

2002-02-15 Thread Randal L. Schwartz
> "Michael" == Michael Fowler <[EMAIL PROTECTED]> writes: Michael> Heh, you still have that backwards. oct() interprets its argument as an Michael> octal value, and returns its decimal equivalent. Interesting that you use "decimal" here... Michael> Also, it's best not to think of functions

Re: octal file permissions

2002-02-15 Thread Randal L. Schwartz
> "Zentara" == Zentara <[EMAIL PROTECTED]> writes: Zentara> After putting on the dunce cap and typing 100 times: Zentara> "the oct function takes a decimal value and returns octal, Zentara> and (stat file)[2] returns a decimal value" I finally see it. Zentara> I think I do anyways. :-) No

Re: octal file permissions

2002-02-14 Thread zentara
On Thu, 14 Feb 2002 07:57:07 -0900, [EMAIL PROTECTED] (Michael Fowler) wrote: >I'm tempted to say oct and sprintf's %o are symmetric, meaning they reverse >each other. You can think of it that way if it helps, but it might confuse >you in the case of oct(0500) and sprintf("%o", 0500). Ok, I ha

Re: octal file permissions

2002-02-14 Thread Michael Fowler
On Thu, Feb 14, 2002 at 10:43:41AM -0500, zentara wrote: > On Wed, 13 Feb 2002 15:14:39 -0900, [EMAIL PROTECTED] (Michael Fowler) wrote: > > >You have it backwards. Octal 100500 is 33088 in decimal. You just did the > >conversion with the oct operator. > > > >You're confused about what oct does

Re: octal file permissions

2002-02-14 Thread zentara
On Wed, 13 Feb 2002 15:14:39 -0900, [EMAIL PROTECTED] (Michael Fowler) wrote: >You have it backwards. Octal 100500 is 33088 in decimal. You just did the >conversion with the oct operator. > >You're confused about what oct does; it returns the decimal representation >of an octal value. Also, Pe

Re: octal file permissions

2002-02-13 Thread Michael Fowler
On Wed, Feb 13, 2002 at 05:20:38PM -0500, zentara wrote: > Ok, I can understand that because 33088 = oct(100500) > but given the octal number 33088 what function do I use > to convert it to 100500? In other words what is the > procedure to do octal to decimal conversion? You have it backwards.

Re: octal file permissions

2002-02-13 Thread Tanton Gibbs
To change from decimal to octal, you can use sprintf with a %o format string my $val = sprintf( "%o", 8 ); print $val; 10 - Original Message - From: "zentara" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 13, 2002 5:20 PM Subject: octal file permissions > > I