in reply to Unwanted Octal to Decimal Conversion

I can't see the real problem here.
#!/usr/bin/perl use constant GROUP_READ => 0040; use constant OWNER_READ => 0400; my $mask = GROUP_READ | OWNER_READ; printf "my mask is %04o", $mask;
Boris

Replies are listed 'Best First'.
Re: Re: Unwanted Octal to Decimal Conversion
by ambrus (Abbot) on Feb 18, 2004 at 21:02 UTC

    I recommend "%05o" or "%#04o" because permission are 12 bit long and this way there will always be a preceding zero to indicate octalness.

      You are right. then I like "0%04o". It is most readable for me.
      Boris