[DGD]Cat / More

Erwin Harte harte at xs4all.nl
Mon Feb 26 21:10:41 CET 2001


On Mon, Feb 26, 2001 at 03:03:13PM -0500, Michel Racicot wrote:
>   Hi there, how can i code some kind of pause (to do a "cat" or "more"
>   like command) anyone as some advice ?

Look at the 2.4.5 implementation, perhaps.  A combination of a modified
read_file() + input_to() functionality.

>   I suppose i'll have to use read_file ... ;o) Or maybe editor ??? I
>   found out a way but i wonder if there is some "best way" to do it... 

Both work, but for really large files I'd recommend against editor
because it needs to read in the entire file before being able to do
anything.  Rather laggy.

>   Is there some kind of way to obtain the file size (to later use as
>    some offset system for the optionals read_file parameters...) ?

I suggest you look at the get_dir() kfun.

>   Actually, i do read the file in a single string and display some part
>   of it using subsets ... then i flip my user in a "waiting" state to
>   wait for enter to be pressed... 

So what do you do for files larger than the maximum string size? :-)

Erwin.
-- 
Erwin Harte      : `Don't mind Erwin, he gets crabby. :)'
harte at xs4all.nl  :    -- Par Winzell <zell at skotos.net>

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list