Topic Path: Symbol Reference > Classes > TIdFTP Class > TIdFTP Methods > FileStructure Method
TIdFTP.FileStructure Method

Defines the way data is represented in FTP data transfer operations.

procedure FileStructure(
    AStructure: TIdFTPDataStructure
File structure requested by the FTP client. 

FileStructure is a procedure used to implement support for the FTP STRU command on the FTP client. The FTP STRU command is used to define the way in which data is represented in FTP data transfer operations. The value in AStructure indicates the representation required for the FTP client, and can contain the following values and meanings: 


No internal structure is used, and the file is considered to be a continuous sequence of data bytes. 
The file is made up of sequential records. 
The file is made up of independent indexed pages. 


dsFile is the value normally used for FTP data transfers involving text or binary file content. The structure of a file may affect both the transfer mode of a file and the interpretation and storage of the file. 

With some sites being naturally file-oriented and others naturally record-oriented there may be problems if a file with one structure is sent to a host oriented to the other. If a text file is sent with record-structure to a host which is file oriented, then that host should apply an internal transformation to the file based on the record structure. Obviously, this transformation should be useful, but it must also be invertible so that an identical file may be retrieved using record structure. 

In the case of a file being sent with file-structure to a record-oriented host, there exists the question of what criteria the host should use to divide the file into records which can be processed locally. If this division is necessary, the FTP implementation should use the end-of-line sequence, CRLF for ASCII, or NL for EBCDIC text files, as the delimiter. If an FTP implementation adopts this technique, it must be prepared to reverse the transformation if the file is retrieved with file-structure. 

For more detailed information about implementing the FTP STRU command, please refer to RFC 959.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.