Can Unix Mount .TAR.GZ and .ZIP Files?
rhadc asks: "We can mount filesystems. We are constantly downloading .zip files and .tar.gz's. Why can't we mount .tar.gz's or .zip files? Mounting compressed packages and archives would make installation of software a little easier. Depending on how it was implemented, it could also require less disk space than the current method: Download, unzip, work/play. I've been a C programmer for a while, although taking on a large filesystem-type project isn't something I have time for, right now." It's just a matter of some enterprising (or bored) hacker writing file system drivers which use /dev/loop*, isn't it? Are there any projects looking to do something like this? Programs that cheat and actually untar the file to a teporary directory don't count.
It's funny this question should come up now - the web server Roxen added support for mounting a tar file in it's virtual file space earlier today.
--
Its on freshmeat, it took me two minutes to find it.
http://www.inf.bme.hu/~mszeredi/avfs/
Baz
There is a patch that should make it into Linux 2.4. It is included in VALinux's unsupported kernels from HJL (as well as Ext3 and NFS, and don't forget the losetup/mount RPMs as well).
Otherwise, I just use Midnight Commander (mc) to peer into and even modify TAR, TAR.GZ, CPIO, RPM and other files. In fact, if you're serious about working on compressed files, why not get into RPM where you can script (among other things)?
-- Bryan "TheBS" Smith
-- Bryan "TheBS" Smith
Independent Author, Consultant and Trainer
The latest userfs code would compile on kernels 1.3/2.0, although it looks like someone has made it compile with 2.2/glibc. The author's page on userfs is at: http://www.goop.org/~jeremy/userfs/
If you all you want is read-only access, I don't see too much of a problem - it would be sort of like a CD ROM. Don't expect a timestamp on last access....
But read/write would be tough, because then you'd have to deal with fragmentation of files and gaps after a delete. Neither tar nor *zip would like that at all....and copying over to a new archive file defeats the purpose.
Midnight Commander has in it a nice user-space VFS layer (which is set to become the Gnome VFS layer). You just hit enter on a tgz or zip file, and you 'view' it much like RAR did in DOS years ago.
:)). Then just exit. Very clean and fast.
Another cool thing is you can also have ftpfs, undelfs, and other interesting file systems through this MC VFS. The power is really apprent when you need a single file from a archive on an FTP site. Just connect to the FTP, browse to the dir, hit enter on the archive, browse to the file, and hit F5 to copy to the other pane (which has the proper CWD
--
--
Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
Many years ago when the Linux version number was less than one (approx 0.99) there was a rather cool user file system - a filesystem that ran in user space. It was easy to add custom file systems and the source came with an example for entering tarred archives exactly as you ask. Another neat example were symbolic links that were *executed* rather than followed. So 'ln -s "echo hi" hello' followed by 'cat hello' would give 'hi'. Another example was mounting the entire ftp world so you could just 'cd /ftp/ftp.slashdot.org' or whatever. It was fun to play with.
--
-- SIGFPE