Perl's umask equivalent command

Discussion in 'Perl Misc' started by E Arredondo, Oct 4, 2005.

  1. E Arredondo

    E Arredondo Guest

    Hi,

    I need all files created to be -rw-rw-rw , on unix I would put at the top of
    the script:

    #!/bin/ksh
    umask 0


    Can I use umask on perl ?

    #!/usr/bin/perl -w
    umask 0

    Thanks
    E Arredondo, Oct 4, 2005
    #1
    1. Advertising

  2. E Arredondo

    Anno Siegel Guest

    E Arredondo <> wrote in comp.lang.perl.misc:
    > Hi,
    >
    > I need all files created to be -rw-rw-rw , on unix I would put at the top of
    > the script:
    >
    > #!/bin/ksh
    > umask 0
    >
    >
    > Can I use umask on perl ?
    >
    > #!/usr/bin/perl -w
    > umask 0


    What happened when you ran this? See "perldoc -f umask".

    Anno
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
    Anno Siegel, Oct 4, 2005
    #2
    1. Advertising

  3. E Arredondo

    Paul Lalli Guest

    E Arredondo wrote:
    > I need all files created to be -rw-rw-rw , on unix I would put at the top of
    > the script:
    >
    > #!/bin/ksh
    > umask 0
    >
    > Can I use umask on perl ?
    >
    > #!/usr/bin/perl -w
    > umask 0


    Have you read the documentation for the function you want to use?

    perldoc -f umask

    Paul Lalli
    Paul Lalli, Oct 4, 2005
    #3
  4. E Arredondo <> wrote a SAQ:


    > Can I use umask on perl ?



    Yes, perl has a function for using a umask.

    I'll leave it as an exercise for the reader to guess
    what such a function might be named...


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Oct 4, 2005
    #4
  5. "E Arredondo" <> wrote in message
    news:N5x0f.1$...
    > Hi,
    >
    > I need all files created to be -rw-rw-rw , on unix I would put at the top
    > of the script:
    >
    > #!/bin/ksh
    > umask 0
    >
    >
    > Can I use umask on perl ?
    >
    > #!/usr/bin/perl -w
    > umask 0


    Congratulations!! You've just earned yourself an entry in the Perl SAQ

    http://www.ginini.com/perlsaq.html
    Peter Sundstrom, Oct 5, 2005
    #5
  6. E Arredondo

    E Arredondo Guest

    "Peter Sundstrom" <> wrote in message
    news:DmL0f.16135$...
    >
    > "E Arredondo" <> wrote in message
    > news:N5x0f.1$...
    >> Hi,
    >>
    >> I need all files created to be -rw-rw-rw , on unix I would put at the top
    >> of the script:
    >>
    >> #!/bin/ksh
    >> umask 0
    >>
    >>
    >> Can I use umask on perl ?
    >>
    >> #!/usr/bin/perl -w
    >> umask 0

    >
    > Congratulations!! You've just earned yourself an entry in the Perl SAQ
    >
    > http://www.ginini.com/perlsaq.html
    >
    >


    That is fantabulous. I've just started programming with Perl (5 days ago)
    and I'm already included on the honorable perlsaq list.
    E Arredondo, Oct 5, 2005
    #6
  7. E Arredondo

    Paul Lalli Guest

    E Arredondo wrote:
    > That is fantabulous. I've just started programming with Perl (5 days ago)


    You would do well, then, to read some built-in documentation. Of
    possible interest to you would be:
    perldoc perlfunc
    for an alphabetical, and by-category, list of all Perl built-in
    functions
    perldoc perltoc
    for a listing of all the available documentation
    perldoc perlintro
    for an introduction to get you started.

    This is not intended to be mean, cruel, harsh, sarcastic, or in any
    other way not-nice. It is a genuine effort to show you what help is
    available for new Perl programmers.

    Paul Lalli
    Paul Lalli, Oct 5, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yves Glodt

    spawnle & umask

    Yves Glodt, Dec 8, 2005, in forum: Python
    Replies:
    0
    Views:
    296
    Yves Glodt
    Dec 8, 2005
  2. Yves Glodt

    Re: spawnle & umask

    Yves Glodt, Dec 8, 2005, in forum: Python
    Replies:
    3
    Views:
    350
    Donn Cave
    Dec 8, 2005
  3. Faik Uygur

    umask option for tarfile extract

    Faik Uygur, Jun 15, 2006, in forum: Python
    Replies:
    0
    Views:
    375
    Faik Uygur
    Jun 15, 2006
  4. Faik Uygur

    getting umask without changing it

    Faik Uygur, Jun 16, 2006, in forum: Python
    Replies:
    0
    Views:
    225
    Faik Uygur
    Jun 16, 2006
  5. Daniel Berger

    umask vs umask

    Daniel Berger, Apr 13, 2008, in forum: Ruby
    Replies:
    8
    Views:
    125
    Heesob Park
    Apr 16, 2008
Loading...

Share This Page