Write File

The Write File activity is a synchronous activity that writes content to the specified file.

General

The General tab has the following fields.

Field Literal Value/Process Property/Module Property Description
Name None The name to be displayed as the label for the activity in the process.
Filename Yes The path and name of the file.

Wildcards are not permitted in this field.

Append None Appends the contents to an existing file. Not selecting this check box overwrites the file.
Write as Literal Value Specify whether Text or Binary.
Create Non-Existing Directories None When selected, the activity creates all directories in the specified path, if they do not already exist.

If this check box is not selected with one or more non-existing directories in the specified path, it throws an exception.

Compress None This field specifies whether to compress the output file using GZip format. Specify None for no compression or GZip for a compressed output file.

When you specify GZip for this field, rename the file to use the .gz suffix and use gunzip to decompress the file.

Include Timestamp None Select the check box to display timestamp, in addition to the date.

Description

Provide a short description for this activity.

Input

The following is the input for the activity.

Input Item Datatype Description
fileName string The path and name of the file.

Wildcards are not permitted in this field.

textContent string The contents of the file (text files). This field is present when Write as is set to Text. When Write as is set to Binary, this field is replaced by the field binaryContent.
addLineSeparator boolean This specifies whether to add a carriage return after each input line. This field is present when the value of the Write as field on the General tab is set to Text.
encoding string The character encoding for text files.

This element is available only when Text is specified in the Write as field on the General tab.

You can specify encoding names supported by Java in this element. If this element is not specified, the default encoding of Java Virtual Machine is used.

Output

The following is the output for the activity.

Output Item Datatype Description
fileInfo complex This element contains the fileName, location, type, readProtected, writeProtected, and size data.
fullName string The name of the file, including the path information.
fileName string The name of the file without the path information.
location string The path to the file.
configuredFileName string An optional element. This element is not populated by this activity.
type string The file type.
readProtected boolean Signifies whether the file or directory is protected from reading
writeProtected boolean Signifies whether the file or directory is protected from writing
size integer The size of the file in bytes.
lastModified string The timestamp indicating when the file was last modified.

Fault

The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective action to take, see the TIBCO BusinessWorks™ Container Edition Error Codes guide.

Fault Generated When..
FileNotFoundException The file does not exist.
UnsupportedEncodingException The encoding is not valid.
FileIOException An input/output exception occurs when trying to write to the file.