Mail Archives: djgpp/2001/05/31/10:05:11
On Wed, 30 May 2001, David Witbrodt wrote:
> > FWIW, you could have just downloaded and installed the fil???b.zip package
> > which contains the `ls', `df', and `du' commands. These commands will list
> > the contents of a directory, show (estimate?) remaining disk space, and
> > show how much space a file or directory uses. With the --color=auto
> > command-line option to `ls' you can get colored output on your colored
> > monitor. To get paging, there is the `less' pager that comes in its own
> > package.
> [...]
> Besides, in real life reinventing the wheel is probably silly, but
> in programming (and other technical subjects) it is usually quite
> necessary, in my view. I watch C++ students sweat blood every
> semester trying to learn how to use array indexing correctly, set up
> and manipulate linked lists without error, and simply get cout to
> format their output the way they want it. Since I haven't installed
> fil316b, I don't know whether I can get ls, df, and du (or a script
> using them) to do exactly what I want, but I do know that this program
> I'm writing -- which is nearly finished and works pretty good so far
> -- _does_ do exactly what I want. And I disagree: it _is_ good
> practice.
Even if you do want to reinvent the wheel, you might benefit from looking
into the sources of `ls' to see how does it go about colorizing the
output. You can then choose whether to use the same method or do
something different.
After all, that's what's great about Free Software: the sources are there
to be perused and studied.
- Raw text -