Re: Newbie Question - Help with design

From: Mike Chirico (mchirico_at_comcast.net)
Date: 12/13/03


Date: Fri, 12 Dec 2003 20:37:22 -0500


"Jamie" <jamie@gnulife.org> wrote in message
news:20031212190126.L96527-100000@floyd.gnulife.org...
>
>
> Hello,
>
> I am studying the C language, and I work mostly with FreeBSD at my job.
> I need to write a program which will check all of the files in a
> directory, and if one is over 20 megs, I need to compress it and move it
> to an archive directory.
>
> I realize that it would be very easy to do this with a shell script,
> but since I am studying C, I would like to make a C program to do the job
> for the coding practice.

Well, for the people who have to uncompress that data, I'd recommend calling
the "zlib" library from your C program.

http://www.gzip.org/zlib/

Take a look at minigzip.c in the download, which does it all. It can be
compiled as follows:

gcc minigzip.c -lz -o minigzip

And, anyone who has to use the files can just "gunzip" them; which will
probably keep them happy.

Regards,

Mike Chirico



Relevant Pages

  • Re: Newbie Question - Help with design
    ... >> I am studying the C language, and I work mostly with FreeBSD at my job. ... >> to an archive directory. ...
    (comp.unix.programmer)
  • Newbie Question - Help with design
    ... I am studying the C language, and I work mostly with FreeBSD at my job. ... directory, and if one is over 20 megs, I need to compress it and move it ... to an archive directory. ... I realize that it would be very easy to do this with a shell script, ...
    (comp.unix.programmer)
  • Self Inflicted "Immersion" Program
    ... Although I live in Japan (I've been here over a year now, ... studying the language when I arrived), I find myself in a very "faux" ... Japanese (language) enviornment. ...
    (sci.lang.japan)
  • Re: [object Object] ?
    ... Stefan Weiss wrote: ... The things I have learnt this far during ... language in the natural way. ... Crockford, whose pages I have been studying like Bible, admits having ...
    (comp.lang.javascript)
  • Re: Some German...
    ... The reason I post this is because I will be studying abroad ... without some German juggling vocabulary. ... Here's one language oddity that came to light at a german convention ...
    (rec.juggling)