B.45 Tempfile Task

This task sets a property to the name of a temporary file. Unlike PhingFile::createTempFile(), this task does not actually create the temporary file, but it does guarantee that the file did not exist when the task was executed.

Table B.47: Attributes

NameTypeDescriptionDefaultRequired
propertyStringSets the property you wish to assign the temporary file to.n/ayes
destdirStringSets the destination directory. If not set, the basedir directory is used instead.basedirno
prefixStringSets the optional prefix string for the temp file.n/ano
suffixStringSets the optional suffix string for the temp file.n/ano
deleteonexitBooleanWhether the temp file will be marked for deletion on normal exit (even though the file may never be created).falseno
createfileBooleanWhether the temp file should be created by this task.falseno

B.45.1 Example

<tempfile property="temp.file"/>

create a temporary file

<tempfile property="temp.file" suffix=".xml"/>

create a temporary file with the .xml suffix

<tempfile property="temp.file" destDir="build"/>

create a temporary file in the build subdirectory