Re: [Tutor] tarfile +stdin

2006-12-19 Thread wesley chun
> >>> tbz.add(sys.stdin) > Traceback (most recent call last): >File "", line 1, in > : > return s.startswith('/') > AttributeError: 'file' object has no attribute 'startswith' altho i cannot help you with your original query, i *can* tell you that the reason why you ge

[Tutor] tarfile +stdin

2006-12-19 Thread Martin Marcher
Hello, I'm trying to create a backup script which in one of the last steps is to create a tarball that is possibly gzipped or bzipped2. >>> import tarfile >>> tbz = tarfile.open(name="tarfile.tar.bz2", mode="w:bz2") >>> tbz.add("myfile.dmp") >>> for tarinfo in tbz: ... print tarinfo.name