Skip to content

CreateFile

Akshin Mustafayev edited this page Sep 4, 2022 · 4 revisions

CreateFile

SYNOPSIS

Creates text file with the specified content in the given directory.

SYNTAX

  - ActionType: CreateFile
    ActionDescription: 
    Name: 
    Content: 
    Encoding: 
    Append: 
    ExactVariableCheck:

EXAMPLES

EXAMPLE 1

  - ActionType: CreateFile
    ActionDescription: Create a Readme file
    Name: D:\new_file.txt
    Content: "This is a README file \n
    Some useful information \n
    Second information on the second line"
    Encoding: ASCII
    Append: true
    ExactVariableCheck: false

EXAMPLE 2

  - ActionType: CreateFile
    Name: D:\new_file.txt
    Content: Hello

EXAMPLE 3

  - ActionType: CreateFile
    Name: D:\new_file.txt
    Content: some text
    Encoding: UTF8
    Append: false

EXAMPLE 4

  - ActionType: CreateFile
    Name: $name
    Content: $dataFromTextFile
    Encoding: UTF8
    Append: false

PARAMETERS

ActionType

This parameter specifies action name. CreateFile value is required for this action to be executed.

Required: true
Default Value: CreateFile
Accepted Value: CreateFile
Accepted Value Type: string
Accepts Variables: false

ActionDescription

This parameter specifies description of the action.

Required: false
Default Value: none
Accepted Value: any
Accepted Value Type: string
Accepts Variables: false

Name

This parameter specifies absolute path to file name which should be saved to.

Required: true
Default Value: none
Accepted Value: any
Accepted Value Type: string
Accepts Variables: true

Content

This parameter specifies contents of the file.

Required: true
Default Value: empty
Accepted Value: any
Accepted Value Type: string
Accepts Variables: true

Encoding

This parameter specifies Unicode for the file.

Required: false
Default Value: ASCII
Accepted Value: ASCII, UTF8, UTF32, Latin1, BigEndianUnicode
Accepted Value Type: string
Accepts Variables: true

Append

This parameter specifies if content should be appended at the end of the file.

Required: false
Default Value: true
Accepted Value: true\false
Accepted Value Type: boolean
Accepts Variables: true

ExactVariableCheck

This parameter specifies how to check YAML file variables specified in other parameters. If value is:

  • true - variable value will be set when it is a separated word. Example: $var1$var2 will not be considered as $var1 and $var2.
  • false - variable value will be set even if it is not separated word . Example: $var1$var2 will be considered as $var1 and $var2.
Required: false
Default Value: none
Accepted Value: true\false
Accepted Value Type: boolean
Accepts Variables: false

NOTES

Clone this wiki locally