ファイルフォーマッタ

Version 22.0.8473


ファイルフォーマッタ


Common File Formatters

The following formatters are the most common file formatters. An example for each formatter is provided for reference.

fileext()

指定されたファイルのファイル拡張子を返します。

Example

<arc:set attr="myFile" value="[FilePath]" />
<arc:if exp="[myFile | fileext() | equals('.err')]">
  <arc:throw code="1" desc="Error file detected." />
</arc:if>

fullpath()

指定されたファイルまたはフォルダの絶対パスを返します。

Example

<arc:set attr="myFile.relativepath" value="../test.xml" />
<arc:set attr="myFile.absolutepath" value="[myFile.relativepath | fullpath()]" />

More File Formatters

Below is the list of less-common formatters not included in the previous section.

directory()

フォルダパスで指定されたディレクトリの名前を返します。

direxists([ifexist][, ifnotexist])

このフォーマッタは、指定されたパスにフォルダが存在する場合はtrue(または_ifexist_ として渡される値)を返し、それ以外の場合はfalse(または_ifnotexist_ として渡される値)を返します。

  • ifexist:ディレクトリが存在する場合に返される値(オプション)。
  • ifnotexist:ディレクトリが存在しない場合に返される値(オプション)。

filectime()

指定されたファイルの作成時刻を返します。

fileexists([ifexist][, ifnotexist])

このフォーマッタは、指定されたパスにファイルが存在する場合はtrue(または_ifexist_ として渡される値)を返し、それ以外の場合はfalse(または_ifnotexist_ として渡される値)を返します。

  • ifexist:ファイルが存在する場合に返される値(オプション)。
  • ifnotexist:ファイルが存在しない場合に返される値(オプション)。

filemtime()

Returns the last modification time of the specified file.

filename()

指定されたファイルのファイル名を返します。

filesize()

指定されたファイルのファイルサイズを返します。

getcwd()

現在の作業ディレクトリを返します。このフォーマッタに渡される属性は無視されるため、デフォルトアイテム’_’ をインプットとして使用するのが一般的です。例:[_ | getcwd()]

ischild(path[, ifchild][, ifnotchild])

path パラメータが属性値で表されるパスの子である場合はtrue(またはifchild)を返し、それ以外の場合はfalse(またはifnotchild)を返します。

  • path:属性値で表されるパスと比較するパス。
  • ifchild:パラメータの値が属性値で表されるパスの子である場合に返される値(オプション)。
  • ifnotchild:パラメータの値が属性値で表されるパスの子ではない場合に返される値(オプション)。

pathcombine(path)

2つのパス文字列を組み合わせます。

  • path:属性値で表されるパスと組み合わせるパス。

rootpath()

指定されたパスのルートディレクトリを返します。

tofilename()

属性値を有効なファイル名に変換します。無効な文字をアンダースコア(_)に置き換えます。