Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] unpacking plan9.9gz from unix

0 views
Skip to first unread message

erik quanstrom

unread,
Dec 3, 2000, 3:00:00 AM12/3/00
to
apologies if this question has been asked before,
but is there any easy way of unpacking plan9.9gz
from linux?

i don't currently hve a compatable machine to
work with, but i'd still like to have a look at the
source code.

Scott Schwartz

unread,
Dec 3, 2000, 3:00:00 AM12/3/00
to
| apologies if this question has been asked before,
| but is there any easy way of unpacking plan9.9gz
| from linux?

Steve Kotsopoulos and Fabricio Chalub produced this perl script
(from the archives of 16 June 2000).

#!/usr/bin/perl
# unwrap gzipped Plan9 wrap(8) format packages
# usage: unwrap pkg.9gz
#
# unpack-plan9.pl, v 11062000
# (c) Fabricio Chalub, cha...@gnu.org

$pkg = $ARGV[0];

open F, "zcat $pkg |" or die "cannot open pipe: $!";

while (<F>)
{
/(.*) (.*) (.*) (.*) (.*) (.*)/;
$filename = $1;
$filename = substr ($filename, 1);
$length = $6;
read F, $buffer, $length;
print "$filename\n";
if ($length == 0)
{
mkdir $filename, 0700;
}
else
{
open O, ">$filename";
print O $buffer;
close O;
}
}

Message has been deleted
0 new messages