home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
pub
/
users
/
Harry
/
Blitz
/
version-1-0
/
OSProject
/
p8
/
cat.c
< prev
next >
Wrap
Text File
|
2006-05-17
|
767b
|
35 lines
code cat
-----------------------------------
---- ----
---- BLITZ "cat" Program ----
---- ----
-----------------------------------
----------------------------- main ---------------------------------
const stdin = 0
stdout = 1
const BUFF_MAX = 30
var buffer: array [BUFF_MAX] of char
function main ()
--
-- This is a simplified version of the 'cat' program found in Unix.
--
var i: int
*((& buffer) asPtrTo int) = BUFF_MAX
while true
i = Sys_Read (stdin, &buffer[0], BUFF_MAX)
if i <= 0
break
endIf
i = Sys_Write (stdout, &buffer[0], i)
endWhile
Sys_Close (stdout)
endFunction
endCode