cluster files in c#

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,

Can I use tar and untar in c#? And if I can how exactly? (didn't find
any code samples)

Thank you!
 
tar and untar are executables, correct? In which case you can use the
System.Diagnostics.Process class and its Start() method to initiate a
process (either of them) with the necessary command line arguments.
 
But how can I get the tar execuable? Which using should I do in c# for
that?

Thanks!
 
But if I want to use only native libraries without third party - can I
do it in c# (I mean tar and gzip)?

Thank you!
 
If you mean using the .NET Framework you can't but the whole #ZipLib
implementation is written in C#. This means that if you do not want to
include the library in your project output you can just include the whole
source code to your project.
 
Can I use tar and untar in c#? And if I can how exactly? (didn't find
any code samples)

You can use any type of file you wish, in any programming language you
wish. First you must understand the file format, and then you must
write code or seek out a library that will parse the file format and
work with it for you from your application.

A tar file is just an archive. ("tar" stands for "tape archive" and
comes from the world of UNIX.) As such, you can see the source code to
an open-source tar program such as GNU tar
(http://www.gnu.org/software/tar) which is written in C, and you can
from that source code see what the tar on-disk formats are (there are a
few different ones from the original tar on to today's versions of
tar).

Secondly, you'll have to decide how to handle tar files if you're going
to be adding to them. Why? Because tar files come from the world of
UNIX-style permissions and have more metadata than, say, ZIP files.
Also, if you control the system you're getting data from, you can
simply request that the system give you ZIP files to work with, if you
just want to work with something you know already.

--- Mike
 
tar and untar are executables, correct? In which case you can use the
System.Diagnostics.Process class and its Start() method to initiate a
process (either of them) with the necessary command line arguments.

No. A tar file ("_t_ape _ar_chive") is a file archiver system (note:
not file compression, just file archiving. It's like a filesystem
embedded in a file, though the filesystem is "packed" together and
there is no room for the files within it to grow, and it doesn't do
fragmented files).

tar is often combined with a compression program (UNIX "compress", GNU
"gzip", or the now quite popular "bzip2"). Sometimes it's kept,
uncompressed. It's wonderful for multi-volume disk and tape archives,
as well as file interchange across systems since nearly every major
multi-format archive handler in existence supports tar (and why not,
the format isn't *that* complex).

--- Mike
 
Back
Top