Mail Archives: djgpp/2000/03/26/07:05:56
No, your idea has the same flaw as the type command, to get functionality like
cat you should use the following instead:
open file as binary;
test if exist;
get file size;
while (current position < size)
{ get character from file;
if (character <> eof)
output to STDOUT
else don't output it
}
end program;
"Robert L." wrote:
>
> So, it's very easy to make this tool :)
>
> open file( in binary);
> test if exist;
> input a char;
> output the char on the STDOUT;
> test if eof mark;
> end program;
>
> Damian Yerrick a écrit dans le message ...
> >On Sat, 25 Mar 2000 14:29:41 +0100, Giacomo Degli Esposti
> ><pad2369 AT iperbole DOT bologna DOT it> wrote:
> >
> >>"Robert L." wrote:
> >>>
> >>> Excuse me, but i don't have cat command in dos ( v. 7 ). I know there's
> one
> >>> in unix.
> >>> If it exist, where can i find it, else what the "spec" of this command.
> >>> ( win98 )
> >>
> >>You can find it in the Textutils package in DJGPP (txtXXXb.zip).
> >>Anyway it is more or less equivalent to the "type" DOS command (i.e. it
> >>copies files to stdout), so you can use "type" instead of "cat".
> >
> >One problem:
> >
> >C:\WINDOWS\Desktop>type /?
> >Displays the contents of text files.
> >
> >TYPE [drive:][path]filename
> >
> >
> >C:\WINDOWS\Desktop>
> >
> >
> >Meaning it'll stop at the first Ctrl+Z. It would be different if
> >there were a /b option to `type'. `cat' is often used to concatenate
> >binary files, much as `copy /b foo.0+foo.1+foo.2 foo.out' is.
> >
> >--
> >Damian Yerrick
> >"I refuse to listen to those who refuse to listen to reason."
> >See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html
> >
> >This is McAfee VirusScan. Add these two lines to your signature to
> >prevent the spread of signature viruses. http://www.mcafee.com/
--
Robin Hugh Johnson
"Robbat2"
QTOD: "I used to be an idealist, but I got mugged by reality."
E-Mail : robbat2 AT t-p-l DOT com
ICQ# : 30269588 or 41961639
Home Page : http://tesla.t-p-l.com
Time Zone : Pacific Daylight (GMT - 8)
- Raw text -