User`s guide

KwikNet Universal File System Interface
K
A
DAK
C - 7
AMX System Startup
Special care must be taken when launching an AMX system which includes both KwikNet
and the AMX/FS File System. Initialize AMX/FS before starting KwikNet. This implies
that execution of AMX/FS Restart Procedure
fj_restart() must precede the call to
KwikNet function kn_enter().
AMX/FS requires that a logical drive be mounted before it can be accessed. This
operation is not supported by the Universal File System interface. Hence, before starting
any KwikNet clients or servers which require file support, your application must call
AMX/FS procedure fjdrvopen() to mount each of the logical drives which these
KwikNet components are permitted to access.
There is no strict rule governing when logical drives should be mounted. The simplest
solution is to have an application task unconditionally mount all available logical drives
and then start KwikNet. In this way, all KwikNet components which require file support
will have access to all logical drives whenever required.
Alternate solutions may better meet your needs. For example, suppose you intend to
have one FTP server task which only requires access to logical drive D:. Your FTP
server task can mount drive D: and then begin operating as an FTP server. Note that
other tasks are not precluded from accessing drive D:. The FTP server task is also not
prevented from accessing another logical drive mounted by some other task.
AMX System Shutdown
When shutting down your AMX application, you must stop KwikNet before terminating
AMX/FS. Hence KwikNet function kn_exit() must reach completion prior to the
execution of AMX/FS Exit Procedure fj_exit().
End of Line Indication
The use of CR (
'\r', ASCII 0x0D), LF ('\n', ASCII 0x0A) or CRLF (CR followed by
LF) as an end of line indicator in text files depends on the interpretation (translation) of
strings by file streaming functions such as
fread() and fwrite().
Although the AMX/FS File System is MS-DOS
®
file format compatible, it does not
provide a streaming level API. For example, the description of
fjopen() states that all
files are read and written in binary mode only. Hence AMX/FS does no translation of the
data, even if the file is opened in text mode.
The Treck file system API supports both binary and record oriented file access. For text
transfers, AMX/FS files are read or written in binary mode through a UFS streaming
buffer. The file system's CRLF end of line indicator is stripped or added as the text
record is transferred to or from users such as an FTP client, FTP server or Web Server.
For binary transfers, AMX/FS files are read or written in binary mode and passed
unaltered to or from the users of the file system.