mkdir
在 SFTP 或 FTP 服务器上创建新文件夹
说明
示例
连接到 FTP 服务器并创建一个文件夹。导航到该文件夹并上传文件。此示例显示 ftp.example.com
(实际上并不存在的计算机)上的一个假想 FTP 会话。如果您访问的 FTP 服务器允许您在该服务器上上传文件和创建文件夹,则可以像本例中一样使用 mkdir
函数。
首先,连接到服务器。
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
创建名为 scripts
的文件夹。
mkdir(s,'scripts')
显示当前文件夹的更新后的内容,包括新的 scripts
文件夹。
dir(s)
myscript.m README.txt pub scripts
导航到 scripts
文件夹并上传文件。
cd(s,'scripts'); mput(s,'myNewScript.m')
输入参数
与 SFTP 或 FTP 服务器的连接,指定为 SFTP 对象或 FTP 对象。
SFTP 或 FTP 服务器上的新文件夹,指定为字符向量或字符串标量。
版本历史记录
在 R2006a 之前推出
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)