rmdir
删除 SFTP 或 FTP 服务器上的文件夹
说明
示例
删除文件夹
连接到 FTP 服务器并删除该服务器上的一个文件夹。此示例显示 ftp.example.com
(实际上并不存在的计算机)上的一个假想 FTP 会话。如果您拥有 FTP 服务器帐户,有权在该服务器上上传或更改文件,则可以像本例中一样使用 rmdir
函数。
首先,连接到服务器。
s = ftp('ftp.example.com')
FTP with properties: Host: "ftp.example.com" Username: "anonymous" Port: 21 ServerLocale: "en_GB" DirParserFcn: @matlab.io.ftp.parseDirListingForUnix Mode: "binary" LocalDataConnectionMethod: "passive" RemoteWorkingDirectory: "/"
显示 FTP 服务器上当前文件夹的内容。
dir(s)
myscript.m README.txt pub
从 FTP 服务器上删除 pub
文件夹。
rmdir(s,'pub')
在 FTP 服务器上显示更新后的内容。
dir(s)
myscript.m README.txt
输入参数
s
— 连接到 SFTP 或 FTP 服务器
SFTP 对象 | FTP 对象
与 SFTP 或 FTP 服务器的连接,指定为 SFTP 对象或 FTP 对象。
folder
— 远程文件夹
字符向量 | 字符串标量
要删除的远程文件夹,指定为字符向量或字符串标量。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)