User`s guide
KwikNet Virtual File System
K
A
DAK
263
kvf_read kvf_read
Purpose Read from a Virtual File
Used by
n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure
Setup Prototype is in file KN_FILES.H.
#include "KN_LIB.H"
#include "KN_FILES.H"
size_t kvf_read(void *buf, size_t size, size_t cnt,
KN_VFILE *vfd);
Description Buf is a pointer to storage for the data items to be read from the file.
Size is the size in bytes of each item which is to be read from the file.
Cnt is the number of items to be read from the file.
Vfd is a virtual file descriptor identifying an open virtual file to be read.
Note For best efficiency when reading bytes from a file, set size to 1 and cnt
to the number of bytes to be read.
Returns If successful, a value of n is returned where n is the number of full size
data items read from the file. The value n will be less than cnt if the end
of file is reached before cnt items of size bytes each can be read. The
virtual file pointer is incremented by the number of bytes actually read.
If size is 0 or cnt is 0, the value 0 is returned and the storage at *buf is
unaltered.
If parameter vfd does not reference an open virtual file and there is no
underlying file system to handle the request, a value of
-1 is returned.
Note If the parameter vfd does not reference a currently open virtual file, the
request is passed on via the
KwikNet Universal File System Interface to the
underlying real file system, if one exists. In such a case, the return value
will be dictated by the equivalent fread() function.
See Also
kvf_close(), kvf_open()