Creates a file if the stream source is a file. Creates a temporary file if the stream source is not a file.
as-file(stream:stream) -> string |
Name |
Type |
Description |
---|---|---|
stream |
stream |
Specifies the stream source. |
The following job creates a file called file.txt with one line of text. First, the stream-from-string function generates a stream from the text supplied as argument. Next, the as-file function takes the stream as argument and generates a temporary file from it. To copy the temporary file to a permanent path, the built-in copy function is called from a separate execution step. The file is copied to the working directory of the job (C:\FlowForce) and will be overwritten each time the job runs.