Internet Direct (Indy)
Home
PreviousUpNext
TIdFTP.ChangeDirUp Method

Changes to the parent directory on the FTP server.

Pascal
procedure ChangeDirUp;

ChangeDirUp is a procedure used to change the current directory up one level in the file system for the FTP server. 

ChangeDirUp sends the FTP CDUP command to change to the parent directory on the servers file system. 

RFC 959 indicates that reponse code 200 is the proper success response code for the CWUP command, but mentions that CDUP may also returns the 250 response code permitted for CWD. Indy will recognize both response codes 200 and 250 as the success response code for the CDUP command. 

According to RFC 959, ChangeDirUp may encounter any of the following error responses in the FTP protocol: 

 

Code 
Meaning 
500 
Syntax error, command unrecognized. (This may include errors such as command line too long.) 
501 
Syntax error in parameters or arguments. 
502 
Command not implemented. 
421 
Service not available, closing control connection. (This may be a reply to any command if the service knows it must shut down.) 
530 
Not logged in. 
550 
Requested action not taken. File unavailable (e.g., file not found, no access). 

 

When one of these protocol error responses is received, an EIdProtocolReplyError is raised. The ReplyErrorCode for the exception is set to the numeric portion of the protocol response. The Message for the exception is set to the textual part of the protocol response, and may vary based on the exact values returned from the server implementation. 

Use the ChangeDir method to move to a specified directory on the server file system.

EIdProtocolReplyError 

ChangeDir

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.