:SetDirectoryFormat()


Class

     aprFTP()

 

Syntax

     :SetDirectoryFormat( nFormat, [hSession]) -> nNewFormat

 

Parameters

 

nFormat

Numeric. Used to specify the format of the file list returned by the server.

See table below.

 

hSession

Optional: If hSession is not passed, the value in :Session will be used

 

nFormat: The following values are recognized:

Constant

Description

FTP_DIRECTORY_AUTO

This value specifies that the library should automatically determine the format of the file lists returned by the server.

FTP_DIRECTORY_UNIX

This value specifies that the server returns file lists in the format commonly used by UNIX servers (i.e.: the output from the /bin/ls command)

FTP_DIRECTORY_MSDOS

This value specifies that the server returns file lists in the format commonly used by MS-DOS based systems. This includes Windows NT servers.

FTP_DIRECTORY_VMS

This value specifies that the server returns file lists in the format commonly used by VMS servers.

FTP_DIRECTORY_STERLING_1
FTP_DIRECTORY_STERLING_2 

This value specifies that the server returns file lists in the proprietary formats used by the Sterling server, which is used for EDI (Electronic Data Interchange) applications.

 

 

Return

If the method succeeds, the return value identifies the file list format used by the server.

 

If the function fails, the return value is FTP_ERROR.

To get further error information see :nErr and :cErr

To see the remote server's response, see :GetResultCode() and :GetResultString().

 

Description

The :SetDirectoryFormat() method is used to specify the format used by the server when returning a list of files. The format type is used internally by the library when parsing directory listings. The default value is FTP_DIRECTORY_AUTO, which specifies that the library should automatically determine the format based on the server type and the output returned by the server.

  

This method should only be used when library cannot automatically determine the directory format returned by the server. To determine the format used by a server after a file list has been retrieved, use the :GetDirectoryFormat() method.

 

See Also

:CloseDirectory(), :GetDirectoryFormat(), :GetFileStatus(), :GetFirstFile(), :GetNextFile(), :OpenDirectory()