Main Content

close

SFTP または FTP サーバーへの接続を閉じる

構文

説明

close(s) は、s に関連付けられた SFTP または FTP サーバーへの接続を閉じます。

すべて折りたたむ

FTP サーバーへの接続を開きます。その後、セッションが終了したときに接続を閉じます。

まず、National Centers for Environmental Information (NCEI、米国環境情報センター) の FTP サーバーに接続します。

s = ftp('ftp.ngdc.noaa.gov')
  FTP with properties:

                         Host: "ftp.ngdc.noaa.gov"
                     Username: "anonymous"
                         Port: 21
                 ServerLocale: "en_US"
                 DirParserFcn: @matlab.io.ftp.parseDirListingForUnix
                         Mode: "binary"
    LocalDataConnectionMethod: "passive"
       RemoteWorkingDirectory: "/"

サーバー上の内容を表示して、README.txt ファイルを取得します。

dir(s)
 
DMSP                         coastwatch                   international                
INDEX.txt                    dmsp4alan                    ionosonde                    
README.txt                   ftp.html                     mgg                          
STP                          geomag                       pub                          
Snow_Ice                     google12c4c939d7b90761.html  wdc                          
Solid_Earth                  index.html                                                
 
mget(s,'README.txt');

FTP サーバーへの接続を閉じます。

close(s)

FTP サービスは National Centers for Environmental Information (NCEI、米国環境情報センター) により提供されています。NCEI の利用規約は、NCEI Privacy Policy, Disclaimer, and Copyright を参照してください。

入力引数

すべて折りたたむ

SFTP または FTP サーバーへの接続。SFTP オブジェクトまたは FTP オブジェクトとして指定します。

ヒント

  • セッションの最後に close を実行しない場合、接続は、自動的に時間切れになるか、MATLAB® の終了時に切断されます。

  • close は、成功または失敗を示す出力を返しません。

バージョン履歴

R2006a より前に導入

参考

|