Hrm... Looks like no attachments are allowed. Here it is inline. You should
be able to manually extract each file individually so you can tweak the
filename. I use the ExtractContents method here because it works for my
tars...
---
using System;
using System.IO;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Tar;
namespace AssistedSolutions.FileInterface
{
/// <summary>
/// Extracts a tar file using SharpZipLib.
/// </summary>
public class TarExtractor : FileExtractor
{
public override void Extract(string fileName, string path)
{
TarArchive tar = null;
Directory.CreateDirectory(path);
try
{
tar =
TarArchive.CreateInputTarArchive(File.OpenRead(fileName));
tar.ExtractContents(path);
}
finally
{
if (tar != null)
tar.CloseArchive();
}
}
}
}
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Hynes
Sent: Tuesday, October 18, 2005 10:28 AM
To: [email protected]
Subject: RE: [AspNetMetroArea] dotnot class for tar archives?
Here's what I use.
Chris.
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Loll
Sent: Saturday, October 15, 2005 12:10 PM
To: [email protected]
Subject: RE: [AspNetMetroArea] dotnot class for tar archives?
Bill:
Google is your friend. Try SharpZipLib
(http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx). It looks
like you can extract the file to an object, modify the contents, then write
it to disk with your new name.
If you get it working I'd be interested in seeing the code if you don't
mind.
Thanks.
--
Michael Loll / [EMAIL PROTECTED]
>From: "Bill Kearney" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: <[email protected]>
>Subject: [AspNetMetroArea] dotnot class for tar archives?
>Date: Fri, 14 Oct 2005 22:41:23 -0400
>MIME-Version: 1.0
>X-Originating-IP: 66.92.145.79
>X-Sender: [EMAIL PROTECTED]
>Received: from n8.bulk.dcn.yahoo.com ([216.155.201.61]) by
>MC8-F5.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 14 Oct
>2005
>23:24:41 -0700
>Received: from [216.155.201.65] by n8.bulk.dcn.yahoo.com with NNFMP; 15
>Oct
>2005 06:20:28 -0000
>Received: from [66.218.69.4] by mailer2.bulk.dcn.yahoo.com with NNFMP;
>15 Oct 2005 06:20:28 -0000
>Received: from [66.218.66.28] by mailer4.bulk.scd.yahoo.com with NNFMP;
>15 Oct 2005 06:20:28 -0000
>Received: (qmail 97070 invoked from network); 15 Oct 2005 06:20:26
>-0000
>Received: from unknown (66.218.66.217) by m22.grp.scd.yahoo.com with
>QMQP;
>15 Oct 2005 06:20:26 -0000
>Received: from unknown (HELO n10a.bulk.scd.yahoo.com) (66.94.237.44) by
>mta2.grp.scd.yahoo.com with SMTP; 15 Oct 2005 06:20:26 -0000
>Received: from [66.218.69.6] by n10.bulk.scd.yahoo.com with NNFMP; 15
>Oct
>2005 06:20:04 -0000
>Received: from [66.218.66.73] by mailer6.bulk.scd.yahoo.com with NNFMP;
>15 Oct 2005 06:20:04 -0000
>Received: (qmail 71330 invoked from network); 15 Oct 2005 02:42:22
>-0000
>Received: from unknown (66.218.66.217) by m28.grp.scd.yahoo.com with
>QMQP;
>15 Oct 2005 02:42:22 -0000
>Received: from unknown (HELO xbox.wkearney.com) (66.92.145.79) by
>mta2.grp.scd.yahoo.com with SMTP; 15 Oct 2005 02:42:22 -0000
>Received: from media (media.wkearney.com [192.168.12.32])by
>xbox.wkearney.com (Postfix) with SMTP id 75E5EBC4ECfor
><[email protected]>; Fri, 14 Oct 2005 22:41:58 -0400
>(EDT)
>X-Message-Info: JGTYoYF78jHeMy3m8EHiiiWMEJHY/MmrbSZDaRjz+3A=
>Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
>DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lima;
>d=yahoogroups.com;b=dENcGwS8tTw/RJI9OBzaZZc9UIdPDGZhf8q0quuigjv37+vaHWV
>nSN6g4+PnpOM2ajtfU+gfPLEm45xhr7RoBiNlUsgACnsZwM5k6toEDmYT60ae4g/PpQ4gUd
>qbR+JU;
>X-Yahoo-Newman-Property: groups-email
>Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
>X-Apparently-To: [email protected]
>Organization: http://www.ideaspace.net/users/wkearney/foaf.xrdf
>X-MSMail-Priority: Normal
>X-Mailer: Microsoft Outlook Express 6.00.2800.1506
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
>X-eGroups-Msg-Info: 1:12:0:0
>X-eGroups-From: "Bill Kearney" <[EMAIL PROTECTED]>
>X-Yahoo-Profile: wkearney99
>X-eGroups-Approved-By: charlesmarkcarroll <[EMAIL PROTECTED]> via web;
>15 Oct 2005 06:20:02 -0000
>Mailing-List: list [email protected]; contact
>[EMAIL PROTECTED]
>Delivered-To: mailing list [email protected]
>List-Id: <AspNetMetroArea.yahoogroups.com>
>Precedence: bulk
>List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
>Return-Path:
>[EMAIL PROTECTED]
>ahoo.com
>X-OriginalArrivalTime: 15 Oct 2005 06:24:41.0505 (UTC)
>FILETIME=[2056E910:01C5D151]
>
>Hi all,
>
>Anyone know of a dotnet class for handling tar files?
>
>I've got some tar archives that have a ton of files with names that
>aren't legal on NTFS (they contain colon and backslash characters).
>I'd like to be able to extract the files and rename them in the
>process.
>
>Thanks,
>
>-Bill Kearney
>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
Yahoo! Groups Links
----------
using System;
using System.IO;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Tar;
namespace AssistedSolutions.FileInterface {
/// <summary>
/// Extracts a tar file using SharpZipLib.
/// </summary>
public class TarExtractor : FileExtractor
{
public override void Extract(string fileName, string path)
{
TarArchive tar = null;
Directory.CreateDirectory(path);
try
{
tar =
TarArchive.CreateInputTarArchive(File.OpenRead(fileName));
tar.ExtractContents(path);
}
finally
{
if (tar != null)
tar.CloseArchive();
}
}
}
}
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~--> Put
more honey in your pocket. (money matters made easy).
http://us.click.yahoo.com/r7D80C/dlQLAA/cosFAA/X1EolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Put more honey in your pocket. (money matters made easy).
http://us.click.yahoo.com/r7D80C/dlQLAA/cosFAA/X1EolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetMetroArea/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/