User`s guide
KwikNet Universal File System Interface
K
A
DAK
C - 9
C.5 Using a Custom File System
The KwikNet Universal File System (UFS) interface can be adapted to support a custom
file system. To do so, you need only edit file KNFSUSER.H to meet the requirements of
your custom file system. No other customization is required.
Once file KNFSUSER.H is ready, simply edit the File System parameters in your KwikNet
Network Parameter File to reference your custom file system. Then build your KwikNet
Library and link it with your application. The KwikNet Universal File System interface
will then use your custom file system for all file operations.
File KNFSUSER.H serves two purposes. As its name implies, it is a header file which maps
all KwikNet file access functions to those in your file system. However, it is also a code
generating module which can provide a custom version of any file access function which
is not available in your file system. The code generated by this module will actually
reside in KwikNet module KN_FILES.C which is located in the KwikNet TCPIP installation
directory.
The following minimal file system services must be provided by your file system.
Open a file for read, write or append in text or binary mode
Close a file
Write n elements of size m to a file
Read n elements of size m from a file
Seek within a file
Tell location of file pointer within a file
Remove (delete) a file
Flush data to file
Fetch size of file
Rename a file
The following file system services, if provided by your file system, will permit the
KwikNet FTP server to offer directory services.
Make a directory
Remove (delete) a directory
Verify that a path name references a directory
Open a directory for listing files
Close a directory
Read next file entry in an open directory