This commit is contained in:
Andi Jahja
2002-01-19 00:56:47 +00:00
parent 77092c956a
commit 9e5717fa8f
2 changed files with 14 additions and 4 deletions

View File

@@ -7,6 +7,10 @@
For example:
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
enhanced functions, working on any bit range from 1 to 32
all provided by Walter Negro - FOEESITRA <waltern@foeesitra.org.ar>
* contrib/libct/Makefile
* contrib/libct/makefile.bc
* contrib/libct/makefile.vc

View File

@@ -57,7 +57,7 @@
#define BUFFER_LENGTH 2048
FUNCTION __TYPEFILE( cFile, lPrint )
LOCAL nHandle, cBuffer
LOCAL nHandle, cBuffer, nRead := 0, nHasRead := 0, nSize := 0, nBuffer
LOCAL oErr, xRecover, nRetries
LOCAL aSaveSet[ 2 ]
LOCAL cDir, cName, cExt, cTmp, aPath, i
@@ -122,14 +122,20 @@ FUNCTION __TYPEFILE( cFile, lPrint )
aSaveSet[ 2 ] := Set( _SET_PRINTER, .T. )
ENDIF
nSize := FSeek( nHandle, 0, FS_END )
nBuffer := MIN( nSize, BUFFER_LENGTH )
FSeek( nHandle, 0 ) // go top
// here we try to read a line at a time but I think we could just
// display the whole buffer since it said: "without any headings or formating"
cbuffer := SPACE( BUFFER_LENGTH )
cbuffer := SPACE( nBuffer )
? // start in a new line
DO WHILE fread( nHandle, @cbuffer, BUFFER_LENGTH ) > 0
DO WHILE ( nRead := fread( nHandle, @cbuffer, nBuffer )) > 0
nHasRead += nRead
?? cBuffer
cbuffer := SPACE( BUFFER_LENGTH )
nBuffer := MIN( nSize - nHasRead, nBuffer )
cbuffer := SPACE( nBuffer )
ENDDO
FCLOSE( nHandle )