Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Unwanted Octal to Decimal Conversion

by iburrell (Chaplain)
on Feb 18, 2004 at 21:02 UTC ( [id://330061]=note: print w/replies, xml ) Need Help??


in reply to Unwanted Octal to Decimal Conversion

First, you can pad the sprintf output by adding "04" to the format string:
my $octal = sprintf("%04o", OWNER_READ);
Second, I would suggest storing the permissions in the database as decimal integers instead of octal integers or strings. You would display them in octal. This will save all kinds of headaches since the database won't know the numbers are in octal and either won't operate on strings or won't operate wrong thinking they are decimal.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://330061]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found