home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
opus
/
v5
/
opussdk
/
docs
/
bufferedio.doc
< prev
next >
Wrap
Text File
|
1977-12-31
|
5KB
|
216 lines
TABLE OF CONTENTS
dopus5.library/CloseBuf
dopus5.library/ExamineBuf
dopus5.library/FHFromBuf
dopus5.library/FlushBuf
dopus5.library/OpenBuf
dopus5.library/ReadBuf
dopus5.library/SeekBuf
dopus5.library/WriteBuf
dopus5.library/CloseBuf dopus5.library/CloseBuf
NAME
CloseBuf - close a buffered file
SYNOPSIS
CloseBuf(file)
A0
void CloseBuf(APTR);
FUNCTION
Closes a file opened with OpenBuf().
INPUTS
file - file to close
RESULT
Any write data in the buffer is written to disk and the
file is closed.
SEE ALSO
OpenBuf()
dopus5.library/ExamineBuf dopus5.library/ExamineBuf
NAME
ExamineBuf - Examine an open file
SYNOPSIS
ExamineBuf(file, fib)
A0 A1
long ExamineBuf(APTR, struct FileInfoBlock *);
FUNCTION
This function calls ExamineFH() on the underlying DOS file handle.
INPUTS
file - file to examine
fib - FileInfoBlock structure, must be longword aligned
RESULT
Returns DOSTRUE if successful. The FileInfoBlock will contain
information about the open file.
BUGS
If the file is open for writing, the file size reported by this
function may not be accurate.
SEE ALSO
OpenBuf(), dos.library/ExamineFH()
dopus5.library/FHFromBuf dopus5.library/FHFromBuf
NAME
FHFromBuf - get DOS file handle
SYNOPSIS
FHFromBuf(file)
A0
BPTR FHFromBuf(APTR);
FUNCTION
This function returns the underlying DOS file handle for a
buffered IO handle.
INPUTS
file - buffered IO file handle
RESULT
Returns the file handle.
SEE ALSO
OpenBuf()
dopus5.library/FlushBuf dopus5.library/FlushBuf
NAME
FlushBuf - flush file buffer
SYNOPSIS
FlushBuf(file)
A0
void FlushBuf(APTR);
FUNCTION
This function flushes the buffer of a buffered IO file. If there
is any write data in the buffer, it is written to disk.
INPUTS
file - file handle to flush
RESULT
The buffer is flushed.
NOTES
In practice, you never need to call this function.
SEE ALSO
OpenBuf(), WriteBuf(), ReadBuf()
dopus5.library/OpenBuf dopus5.library/OpenBuf
NAME
OpenBuf - open a file for buffered I/O
SYNOPSIS
OpenBuf(name, mode, bufsize)
A0 D0 D1
APTR OpenBuf(char *, long, long);
FUNCTION
This function opens a file for use with the buffered I/O routines.
INPUTS
name - name of the file to open
mode - mode to use
bufsize - size of the buffer to use
RESULT
Returns a buffered file handle if successful, or NULL. This is
not a standard DOS file handle, and can only be used with the
other buffered IO functions.
SEE ALSO
CloseBuf(), dos.library/Open()
dopus5.library/ReadBuf dopus5.library/ReadBuf
NAME
ReadBuf - read data from a buffered file
SYNOPSIS
ReadBuf(file, buffer, size)
A0 A1 D0
long ReadBuf(APTR, char *, long);
FUNCTION
This function reads data from a buffered IO file.
INPUTS
file - buffered IO file handle
buffer - buffer to place data in
size - size to read
RESULT
This function returns the size of the data actually read,
or -1 if an error occurred.
SEE ALSO
OpenBuf(), dos.library/Read()
dopus5.library/SeekBuf dopus5.library/SeekBuf
NAME
SeekBuf - seek within a buffered IO file
SYNOPSIS
SeekBuf(file, offset, mode)
A0 D0 D1
long SeekBuf(APTR, long, long);
FUNCTION
This function sets the read/write position for a buffered IO file.
If the seek takes the position outside of the current buffer, the
buffer will be flushed and re-read automatically.
INPUTS
file - file to seek within
offset - offset to seek
mode - type of seet (OFFSET_BEGINNING, OFFSET_CURRENT, OFFSET_END)
RESULT
Returns the previous file position.
SEE ALSO
OpenBuf(), dos.library/Seek()
dopus5.library/WriteBuf dopus5.library/WriteBuf
NAME
WriteBuf - write data to a buffered IO file
SYNOPSIS
WriteBuf(file, data, size)
A0 A1 D0
long WriteBuf(APTR, char *, long);
FUNCTION
Writes data to a file opened for buffered IO.
INPUTS
file - file handle
data - data to write
size - size to write (-1 works for a null-terminated string)
RESULT
Returns the number of bytes written, or -1 for an error.
SEE ALSO
OpenBuf(), dos.library/Write()