He's saying that umask masks bits, it doesn't cause new files to be created with extra bits set by default.

Most general-purpose apps create general text files with a generic 666 mode, and the system masks with the user's active umask value (e.g., 770 or 700), resulting in a 660 or 600 mode. A compiler might create the final executable (e.g., a.out) with a 777 mode as the point of the executable is to execute it. Since vi doesn't know that the point of a .pl file is to execute it, it doesn't go the extra mile.

(To enhance the OP's question, it does kind of sound cool if vi/emacs/jot/whatever were to make mode choices based on the extension and/or the shebang line, and to "do the right thing" automagically. Making a wrapper script for your favorite editor is a reasonable workaround; making a cronjob or a new version of Unix or bash is not.)

Anyone can write an app to create all files at 777, which would include the executable bit whether it made sense or not. He's not saying compilers are magical in this regard, just that it seems natural in that case.

--
[ e d @ h a l l e y . c c ]


In reply to Re^4: perl file permissions by halley
in thread perl file permissions by BadMagic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.