Tarfile and usernames

Discussion in 'Python' started by Nicholas Cole, Dec 30, 2012.

  1. Dear List,

    I'm hoping to use the tarfile module in the standard library to move some
    files between computers.

    I can't see documented anywhere what this library does with userids and
    groupids. I can't guarantee that the computers involved will have the same
    users and groups, and would like the archives to be extracted so that the
    files are all owned by the extracting user.

    Essentially, I do *not* with to preserve the owner and groups specified in
    the archives.

    What is the right way to achieve this?

    Best wishes,

    Nicholas
     
    Nicholas Cole, Dec 30, 2012
    #1
    1. Advertising

  2. Nicholas Cole

    Hans Mulder Guest

    On 30/12/12 19:57:31, Nicholas Cole wrote:
    > Dear List,
    >
    > I'm hoping to use the tarfile module in the standard library to move
    > some files between computers.
    >
    > I can't see documented anywhere what this library does with userids and
    > groupids. I can't guarantee that the computers involved will have the
    > same users and groups, and would like the archives to be extracted so
    > that the files are all owned by the extracting user.
    >
    > Essentially, I do *not* with to preserve the owner and groups specified
    > in the archives.
    >
    > What is the right way to achieve this?


    I would agree that this ought to be documented.

    From reading the code: the way to achieve this, is to run as a user
    other than root. Or monkeypatch the TarFile.chown method to be a no-op.


    Hope this helps,

    -- HansM
     
    Hans Mulder, Dec 30, 2012
    #2
    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. Ahmed Moustafa
    Replies:
    5
    Views:
    462
    Brian Palmer
    Aug 20, 2003
  2. Albert Hopkins

    Re: Tarfile and usernames

    Albert Hopkins, Dec 30, 2012, in forum: Python
    Replies:
    0
    Views:
    129
    Albert Hopkins
    Dec 30, 2012
  3. Michael Ross

    Re: Tarfile and usernames

    Michael Ross, Dec 30, 2012, in forum: Python
    Replies:
    0
    Views:
    132
    Michael Ross
    Dec 30, 2012
  4. Nicholas Cole

    Re: Tarfile and usernames

    Nicholas Cole, Dec 30, 2012, in forum: Python
    Replies:
    0
    Views:
    138
    Nicholas Cole
    Dec 30, 2012
  5. Replies:
    0
    Views:
    112
Loading...

Share This Page