TarFile using binary strings

Juha Autero Juha.Autero at iki.fi
Tue Aug 12 16:53:30 EDT 2003


"Marc Poinot (Onera)" <marc.poinot at dlr.de> writes:

> Is it possible to avoid the temporary files, and read the stream
> from the binary string coming from DBMS ? The TarInfo object uses a
> fileobj Python type, is there any trick (or module) to make TarInfo
> happy with a 'possible' fileobj-like on a memory zone ?

Well, StringIO provides file-like interface to strings you should be
able to use. Just create TarInfo object, fill up the fields
(especially the size) and then pass it and StringIO object to
TarFile.addfile. 


-- 
Juha Autero
http://www.iki.fi/jautero/
Eschew obscurity!






More information about the Python-list mailing list