Deletes a single file, a specified directory and all its files and
subdirectories, or a set of files specified by one or more
FileSets.
When specifying a set of files, empty directories are not removed by
default.
To remove empty directories, use the includeEmptyDirs attribute.
一つのファイル、指定されたディレクトリ、その内部のすべてのファイルとサブディレクトリ、1つ以上の FileSet によって指定されたファイルのセットを削除します。
ファイルのセットを指定する場合、デフォルトでは空のディレクトリは削除されません。
空のディレクトリを削除するためには、 includeEmptyDirs 属性を使用してください。
If you use this task to delete temporary files created by editors
and it doesn't seem to work, read up on the
default exclusion set
in Directory-based Tasks, and see the
defaultexcludes attribute below.
もしエディタによって作成されたテンポラリファイルを削除するためにこのタスクを使用し、それが動作していないような場合は、 Directory-based Tasks 内の default exclusion set をよく読んで、以下の defaultexcludes 属性を参照してください。
| Attribute | Description | Required |
| file | The file to delete, specified as either the simple filename (if the file exists in the current base directory), a relative-path filename, or a full-path filename. | At least one of the two,
unless a <fileset> is specified. |
| dir | The directory to delete, including all its files and
subdirectories. Note: dir is not used
to specify a directory name for file; file
and dir are independent of each other.WARNING: Do not set dir to
".", "${basedir}",
or the full-pathname equivalent unless you truly intend to
recursively remove the entire contents of the current base directory
(and the base directory itself, if different from the current working
directory). |
|
| verbose | Show the name of each deleted file ("true"/"false"). Default is "false" when omitted. | No |
| quiet | If the specified file or directory does not exist,
do not display a diagnostic message (unless Ant
has been invoked with the ‑verbose or
‑debug switches) or modify the exit status to
reflect an error.
When set to "true", if a file or directory cannot be deleted,
no error is reported. This setting emulates the
-f option to the Unix rm command.
Default is "false".
Setting this to "true" implies setting
failonerror to "false".
|
No |
| failonerror |
Controls whether an error (such as a failure to delete a file)
stops the build or is merely reported to the screen.
Only relevant if quiet is "false".
Default is "true".
|
No |
| includeEmptyDirs | Set to "true" to delete empty directories when using filesets. Default is "false". | No |
| includes | Deprecated. Use <fileset>.
Comma- or space-separated list of patterns of
files that must be deleted. All files are relative to the directory
specified in dir.
|
No |
| includesfile | Deprecated. Use <fileset>.
The name of a file. Each line of
this file is taken to be an include pattern |
No |
| excludes | Deprecated. Use <fileset>.
Comma- or space-separated list of patterns of
files that must be excluded from the deletion list.
All files are relative to the directory specified in dir.
No files (except default excludes) are excluded when omitted. |
No |
| excludesfile | Deprecated. Use <fileset>.
The name of a file. Each line of
this file is taken to be an exclude pattern |
No |
| defaultexcludes | Indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. | No |
| 属性 | 説明 | 必須 |
| file | 削除するファイルです。単純なファイル名(ファイルが現在のベースディレクトリに存在する場合)、相対パスのファイル名、またはフルパスのファイル名、のいずれかを指定します。 | <fileset> が指定されていない場合、2つのうち少なくとも1つが必要。 |
| dir | 削除するディレクトリです。ディレクトリ内のファイルとサブディレクトリをすべて含みます。 注意: dir は file のディレクトリ名を指定するためには使用されません;
file と dir は互いに独立しています。警告:もしあなたが本当に現在のベースディレクトリの全ての内容(と、ベースディレクトリが現在の作業ディレクトリと異なる場合は、ベースディレクトリ自身)を再帰的に削除するつもりでなければ、 dir に "."、 "${basedir}" 、またはそれに相当するフルパス名をセットしないで下さい。 |
|
| verbose | 削除された各ファイルの名前を表示します ("true"/"false" で指定します)。 省略した場合のデフォルトは "false" です。 | No |
| quiet | 指定されたファイルやディレクトリが存在しない場合、原因のメッセージを表示しません
(Antが ‑verbose か ‑debug スイッチを付けて起動されていなければ)。
またはエラーが返ってきた場合の exit ステータスを変更します。
"true" にセットした場合、ファイルやディレクトリが削除できなかった場合は、
エラーを表示しません。
このセッティングは、 Unix の rm コマンドの -f オプションをエミュレートします。
デフォルトは "false" です。
このパラメータを "true" にセットすると、 failonerror パラメータは暗に "false" にセットされます。
|
No |
| failonerror |
エラー(ファイルの削除失敗のような)が発生した時、ビルドを止めるか単にスクリーンに表示するかどうかコントロールします。
quiet が "false" の場合のみ関係があります。
デフォルトは "true" です。
|
No |
| includeEmptyDirs | fileset を使用している場合、"true" にセットすると、空のディレクトリを削除します。 デフォルトは "false" です。 | No |
| includes | 非推奨です。 <fileset> を使用して下さい。
カンマかスペースで句切られた、削除するファイルのパターンのリストです。
すべてのファイルは dir で指定したディレクトリに依存します。
|
No |
| includesfile | 非推奨です。 <fileset> を使用して下さい。
ファイル名を指定します。
指定したファイルの各行は包含パターンとして解釈されます。 |
No |
| excludes | 非推奨です。 <fileset> を使用して下さい。
カンマかスペースで句切られた、削除リストから除外するファイルのパターンのリストです。
すべてのファイルは dir で指定したディレクトリに依存します。
省略した場合、(デフォルト除外ファイル以外の)どのファイルも除外されません。 |
No |
| excludesfile | 非推奨です。 <fileset> を使用して下さい。
ファイル名を指定します。
指定したファイルの各行は除外パターンとして解釈されます。 |
No |
| defaultexcludes | デフォルト除外集合を使用するかどうか("yes"/"no")を示します。省略した場合、デフォルト除外集合が使用されます 。 | No |
<delete file="/lib/ant.jar"/>
deletes the file /lib/ant.jar.
/lib/ant.jar を削除します。
<delete dir="lib"/>
deletes the lib directory, including all files
and subdirectories of lib.
lib ディレクトリを削除します。 lib ディレクトリ内のすべてのファイルとサブディレクトリを含みます。
<delete>
<fileset dir="." includes="**/*.bak"/>
</delete>
deletes all files with the extension .bak from the current directory
and any subdirectories.
現在のディレクトリとそのサブディレクトリの拡張子が .bak のファイルを全て削除します。
<delete includeEmptyDirs="true" >
<fileset dir="build" />
</delete>
deletes all files and subdirectories of build, including
build itself.
build ディレクトリ内のすべてのファイルとサブディレクトリを全て削除します。
build 自身も含みます。
Copyright © 2000-2002,2004 The Apache Software Foundation. All rights Reserved.