ヘルプ センターヘルプ センター
SFTPまたは FTP サーバー上にあるファイルの削除
delete(s,filename)
例
delete(s,filename)は、指定したファイルをsで関連付けられた SFTP または FTP サーバー上の現在のフォルダーから削除します。
s
filename
すべて折りたたむ
FTP サーバーに接続してファイルを削除します。この例では、ftp.example.com(実在しないマシン) での架空 FTP セッションが示されています。FTP サーバーのアカウントを保有し、それにより FTP サーバー上でのファイルのアップロードおよび削除の権限が付与されている場合、この例で示すように関数deleteを使用できます。
ftp.example.com
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という名前のファイルを削除します。
README.txt
delete(s,'README.txt')
更新後の現在のフォルダーの内容を表示します。README.txtファイルはダウンロードできなくなりました。
myscript.m pub
SFTPまたはFTPサーバーへの接続。SFTPオブジェクトまたは FTP オブジェクトとして指定します。
削除するファイルの名前。文字ベクトルまたは string スカラーとして指定します。
ftp|rmdir|sftp
ftp
rmdir
sftp
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office