|
Summary
Change, create, delete, list or rename directory on server.
Description
The DirAction property accesses directories on the FTP server. Subdirectories in the current working directory can be created, deleted and renamed and the current working directory can be
changed or its contents can be listed in short or long format.
| Value |
Meaning |
| DIR_ACTION_ABORT |
Abort directory list action in progress. |
| DIR_ACTION_CHANGE |
Change current working directory. |
| DIR_ACTION_CREATE |
Create subdirectory in current directory. |
| DIR_ACTION_DELETE |
Delete subdirectory in current directory. |
| DIR_ACTION_LIST |
List contents of current directory. |
| DIR_ACTION_PARENT |
Change to parent directory of current directory. |
| DIR_ACTION_RENAME |
Rename subdirectory in current directory. |
This property can be changed at run time only.
Before setting the DirAction property to DIR_ACTION_CREATE, DIR_ACTION_DELETE or DIR_ACTION_RENAME, the name of the subdirectory on which the operation should be performed must be assigned to the
Target property. In case of the DIR_ACTION_RENAME action, the new name of the subdirectory must also be assigned to the NewName property.
Changing the current working directory with the DIR_ACTION_PARENT action does not require any other properties. If the current directory is changed with the DIR_ACTION_CHANGE action, then the Target
property must contain the name of the directory to change to. This target directory can be a subdirectory of the current directory, ".." (identical to DIR_ACTION_PARENT) or a fully qualified path to
a new working directory. This allows an application to change to any directory on the server in just one step.
The contents of the current remote directory can be listed by setting DirAction to DIR_ACTION_LIST. The setting of the ListType property determines if a short or a long listing will be sent. For
every entry in the remote directory, the OnList event is fired. If an application does not want to receive any more entries, then it can set the DirAction property to DIR_ACTION_ABORT in response to
this event. Please check the OnList reference page of more information.
The value of the LastResult property can be checked to determine if the action has been performed successfully.
The AbortDir, ChangeDir, CreateDir, RemoveDir, ListDir, ParentDir and RenameDir methods accomplish the same as the above actions. Please check the reference pages of these methods for more detailed
information on their usage.
There is no default value for this property.
Example
FTPClient.ListType = LIST_TYPE_LONG FTPClient.DirAction = DIR_ACTION_LIST
Note
If you are writing a new application it is recommended to use the corresponding methods for these actions instead.
|