directories:DirectoryExists

Previous Next

Evaluates whether or not a directory designated by a full folder path exists on the file system.

Returns a boolean.

Syntax

directories:DirectoryExists( folderpath )

 

Example

<pc:if test="directories:DirectoryExists($webpages_dir)">
  <pc:then>
    <pc:assign-nodeset webpagesdir="{directories:DirectoryContent($webpages_dir, '*.*', '1', '', '')}"/>
      <pc:terminate test="$webpagesdir/Directory/*" msg="{concat('Error: Publication directory &quot;',$webpages_dir,'&quot; is not empty.')}"/>
  </pc:then>
  <pc:else><pc:CreateDirectories><Directory dirpath="{$webpages_dir}"/></pc:CreateDirectories></pc:else>
</pc:if>