File System Interface

Jump to: navigation, search

Table of Contents >> Application Reference


The file system interface is used by the Treck FTP server, Treck TFTP server, and Treck FTP Client.

Entry points from the FTP server to the file system

tfFSChangeDir() Change current working directory
tfFSChangeParentDir() Change current working directory to parent directory
tfFSCloseDir() Close a directory that we had opened earlier.
tfFSCloseFile() Close a file
tfFSDeleteFile() Delete a file
tfFSGetFileBlockSize() This interface function expects the user to provide the most efficient file block size. Normally it would be the cluster size of the underlying file system. This is used to optimize the file read and write performance. If it returns zero, the default size TM_FS_FILE_BLOCK_SIZE (512) will be used by the stack.
tfFSGetNextDirEntry() Get the next directory entry in the directory open with tfFSOpenDir(), either a long listing of the directory entry (including volumes, sub directories, and file names), or a short listing of the directory (file name only), depending on how the directory was open
tfFSGetUniqueFileName() Given a file name, return a unique file name in the current directory (i.e., if the file name already exists, make up a new name that is unique in the current directory.)
tfFSGetWorkingDir() Get user working directory
tfFSMakeDir() Create specified directory
tfFSOpenDir() Open specified directory, or directory corresponding to a specified pattern to allow getting a long or short listing of the directory or of the directory entries matching the specified pattern
tfFSOpenFile() Open a file (creating it if it does not exist), for read, write, or append, specifying type (ASCII, or binary), structure (stream, or record)
tfFSReadFile() Read n bytes from a file into a buffer
tfFSReadFileRecord() Read a record from a file up to n bytes. Indicates whether EOR has been reached
tfFSRemoveDir() Remove specified directory
tfFSRenameFile() Rename a file
tfFSStructureMount() Mount the user to a new file system data structure
tfFSSystem() Return the system name
tfFSUserAllowed() Indicates whether a specified user is allowed on the system
tfFSUserLogin() Login a user if password is valid
tfFSUserLogout() Logout a user.
tfFSWriteFile() Write some bytes from a buffer to a file
tfFSWriteFileRecord() Write a record from a buffer to a file


Entry points from the FTP client to the file system

Note Note: The Treck FTP client only uses a subset of the functions described above, namely the eight functions in the list below.


Entry points from the TFTP server to the file system

Note Note: The Treck TFTP server only uses a subset of the functions described above, namely the six functions in the list below.


Function Calls


Table of Contents >> Application Reference