rename

Class: FTP

Rename file on FTP server

Syntax

rename(ftpobj,oldname,newname)

Description

rename(ftpobj,oldname,newname) changes the name of the file oldname to newname in the current folder on an FTP server.

Input Arguments

ftpobj

FTP object created by ftp.

oldname

String enclosed in single quotation marks that specifies the original name of the file.

newname

String enclosed in single quotation marks that specifies a new name for the file.

Examples

Suppose that hypothetical FTP server ftp.testsite.com contains a file named testfile.m. Rename the file to final.m:

test = ftp('ftp.testsite.com');
rename(test, 'testfile.m', 'final.m');
close(test);

See Also

| | | |

Was this topic helpful?