DirectoryExists

説明

ディレクトリが存在するかどうかを調べます。

戻り値

指定されたディレクトリが存在する場合は YES、存在しない場合は NO。

カテゴリ

システム関数

関数のシンタックス

DirectoryExists(absolute_path)

関連項目

FileExists

パラメータ

パラメータ 説明

absolute_path

絶対パスです。

<h3>DirectoryExists の例</h3>
<h3>ディレクトリを入力して、その存在を確認します。</h2>
<form action = "directoryexists.cfm" method="post">
   <input type = "text" name = "yourDirectory">
   <br>
   <input type = "submit" name = "submit">
</form>

<cfif IsDefined("FORM.yourDirectory")>
   <cfif FORM.yourDirectory is not "">
   <cfset yourDirectory = FORM.yourDirectory>
      <cfif DirectoryExists(yourDirectory)>
         <cfoutput>
         <p>指定されたディレクトリが存在します。ディレクトリ名は#yourDirectory#
         </cfoutput>
      <cfelse>
         <p>ディレクトリが存在しません。</p>
      </cfif>
   </cfif>
</cfif> 

ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX* | ColdFusion 5* | フォーラム* | デベロッパーセンター | サポート情報 | バグ報告

バージョン7