delete
SFTP または FTP サーバー上にあるファイルの削除
説明
例
ファイルの削除
FTP サーバーに接続してファイルを削除します。この例では、ftp.example.com
(実在しないマシン) での架空 FTP セッションが示されています。FTP サーバーのアカウントを保有し、それにより FTP サーバー上でのファイルのアップロードおよび削除の権限が付与されている場合、この例で示すように関数 delete
を使用できます。
最初に、サーバーに接続します。
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
README.txt
という名前のファイルを削除します。
delete(s,'README.txt')
更新後の現在のフォルダーの内容を表示します。README.txt
ファイルはダウンロードできなくなりました。
dir(s)
myscript.m pub
入力引数
s
— SFTP または FTP サーバーへの接続
SFTP オブジェクト | FTP オブジェクト
SFTP または FTP サーバーへの接続。SFTP オブジェクトまたは FTP オブジェクトとして指定します。
filename
— 削除するファイルの名前
文字ベクトル | string スカラー
削除するファイルの名前。文字ベクトルまたは string スカラーとして指定します。
バージョン履歴
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)