[racket] unpacking tarballs

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Thu Sep 2 05:55:09 EDT 2010

> .plt files are mime encoded gziped tars AFAIK.

".plt" files are base64'd and gzip'd, but I think that's not a 
conventional tar format they're using.  (For another implementation of 
reading ".plt" files, you can see function "quack-pltfile-decode-buffer" 
in Quack.)

For picking apart a tarball, the options I see are:

* Call a C library using the FFI.
* Call the "tar" program.
* Code up a "tar" format reader in Racket.

Caution: When untarring to a filesystem, you have to be careful that you 
don't overwrite files you don't mean to.  You also have to check for 
security exploits that go up the directory tree to write files, or that 
write so-called 'special' files, or files with other (privileged) owner 
or special permissions.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.