API version 1

- ‐

exists

ファイルまたはフォルダの有無を確認します。

呼出形式一覧

呼出形式

説明

boolean exists(string vpath)

ファイルまたはフォルダの有無を確認します。

戻り値一覧

戻り値

説明

boolean

ファイルまたはフォルダが存在すればtrueを、そうでなければfalseを返します。

引数一覧

引数

説明

vpath

確認するファイルまたはフォルダの仮想パスを指定します。

例外

なし

関連項目

isFileisFolder メソッド



使用例 CRSダウンロード

Form Filesys_02 {
   x = 0;
   y = 0;
   width = 800;
   height = 600;

   /*
   このサンプルは
   C:\Users\AppData\Roaming\OpenStream\BizBrowserDT\public_root
   (通常のパブリックルート内に "BizBB/hello.txt" を用意してお試しください)
   hello1.txt は空ファイルでも確認できます
   上書き、削除の確認が出ますので、状況に応じて操作ください
   */

   var fs = new FileSystem;
   print("フォルダーのコピー = ", fs.copy("/BizBB" , "/BizNW" ) ) ;
   print("フォルダーの作成 = ", fs.createFolder( "/NewF" ) ) ;
   print("フォルダーの削除 = ", fs.deleteFile( "/BizNW" ) ) ;
   print("フォルダーの存在 = ", fs.exists( "/BizBB" ) ) ;
   var info = fs.getFileInfo( "/BizBB/hello.txt" )  ;
   print("ファイルの作成時間 ",info.creationTime,info.baseName);
   var vol = fs.getVolumeInfo( ) ;
   print(vol.volumeName);
   print("ファイルなら true --> ",fs.isFile("/BizBB" ) );
   print("フォルダなら true --> ",fs.isFolder("/BizBB" ) );
   print("renameなら true --> " ,fs.rename("NewF", "NNW") ) ;

}