How to create a file with read access rights

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Johny

    #1

    How to create a file with read access rights

    Is it possible to create a file on Linux with access rights?
    For example
    owner can read and write into the file
    others can only read from the file
    Thanks for replies
    L.

  • half.italian@gmail.com

    #2
    Re: How to create a file with read access rights

    On Jun 21, 8:27 am, Johny <pyt...@hope.cz wrote:
    Is it possible to create a file on Linux with access rights?
    For example
    owner can read and write into the file
    others can only read from the file
    Thanks for replies
    L.
    That all depends on your umask. Most commonly, the default value is
    022 which translates to 755 or ower has full control, and all others
    can read and execute. If you'd like to change a specific files
    permissios with python, look into os.chmod()

    ~Sean

    Comment

    • Larry Bates

      #3
      Re: How to create a file with read access rights

      Johny wrote:
      Is it possible to create a file on Linux with access rights?
      For example
      owner can read and write into the file
      others can only read from the file
      Thanks for replies
      L.
      >
      See os.chmod()

      -Larry

      Comment

      • Evan Klitzke

        #4
        Re: How to create a file with read access rights

        On 6/21/07, Johny <python@hope.cz wrote:
        Is it possible to create a file on Linux with access rights?
        For example
        owner can read and write into the file
        others can only read from the file
        Thanks for replies
        Look at the documentation for os.open (for new files) and os.chmod
        (for existing files).


        --
        Evan Klitzke <evan@yelp.co m>

        Comment

        Working...