self._extfileobj = True
self._dbg(3, 'open_volume: using external fileobj {}', fileobj)
self.name = os.path.abspath(name) if name else None
+ self.fileobj.close()
self.fileobj = fileobj
# init data structures
Handles the new volumes
'''
volume_path = "%s.%d" % (base_name, volume_number)
- tarobj.close()
tarobj.open_volume(volume_path, encryption=encryption)
def make_new_encryption_volume_handler(encryption):
# extract with normal tar and check output
os.system("zcat sample.tar.gz 2>/dev/null > sample.tar")
- os.system("tar xf sample.tar")
+ os.system("tar xf sample.tar </dev/null")
assert os.path.exists("big")
assert hash == self.md5sum("big")
# extract with normal tar and check output
os.system("zcat sample.tar.gz 2>/dev/null > sample.tar")
- os.system("tar xf sample.tar")
+ os.system("tar xf sample.tar </dev/null")
assert os.path.exists("big")
assert hash == self.md5sum("big")
# extract with normal tar and check output
os.system("zcat sample.tar.gz 2>/dev/null > sample.tar")
- os.system("tar xf sample.tar")
+ os.system("tar xf sample.tar </dev/null")
assert os.path.exists("big")
assert hash == self.md5sum("big")
fname = "pdtcrypt-object-%d.bin" % (i + 1)
assert os.path.exists(fname)
os.system("zcat '%s' 2>/dev/null > sample.tar" % fname)
- os.system("tar xf sample.tar")
+ os.system("tar xf sample.tar </dev/null")
for fname, digest in hash.items():
assert os.path.exists(fname)
fname = "pdtcrypt-object-%d.bin" % (i + 1)
assert os.path.exists(fname)
os.system("zcat '%s' 2>/dev/null > sample.tar" % fname)
- os.system("tar xf sample.tar")
+ os.system("tar xf sample.tar </dev/null")
for fname, digest in hash.items():
assert os.path.exists(fname)
assert not os.path.exists("big")
# extract and check
- os.system("tar xfM sample.tar")
+ os.system("tar xfM sample.tar </dev/null")
assert os.path.exists("big")
assert hash == self.md5sum("big")
assert not os.path.exists("big")
# extract with normal tar and check output
- os.system("tar xfM sample.tar --file=sample.tar.1")
+ os.system("tar xfM sample.tar --file=sample.tar.1 </dev/null")
assert os.path.exists("big")
assert hash == self.md5sum("big")
assert not os.path.exists("big")
# extract with normal tar and check output
- os.system("tar xfM sample.tar --file=sample.tar.1 --file=sample.tar.2")
+ os.system("tar xfM sample.tar --file=sample.tar.1 --file=sample.tar.2 </dev/null")
assert os.path.exists("big")
assert hash == self.md5sum("big")
os.unlink("small2")
# extract with normal tar and check output
- os.system("tar xfM sample.tar --file=sample.tar.1 --file=sample.tar.2")
+ os.system("tar xfM sample.tar --file=sample.tar.1 --file=sample.tar.2 </dev/null")
for key, value in hash.items():
assert os.path.exists(key)
assert value == self.md5sum(key)
# create the tar file with volumes
os.system("tar cM --format=%s -L 3000 big --file=sample.tar "\
- "--file=sample.tar.1" % self.tar_command_format)
+ "--file=sample.tar.1 </dev/null" % self.tar_command_format)
# check that the tar volumes were correctly created
assert os.path.exists("sample.tar")
# create the tar file with volumes
os.system("tar cM --format=%s -L 3000 big small small2 --file=sample.tar "\
- "--file=sample.tar.1" % self.tar_command_format)
+ "--file=sample.tar.1 </dev/null" % self.tar_command_format)
# check that the tar volumes were correctly created
assert os.path.exists("sample.tar")