Tarfile and usernames

N

Nicholas Cole

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
 
H

Hans Mulder

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top