Create File
  • 14 May 2021
  • 1 Minute to read
  • Dark
    Light
  • PDF

Create File

  • Dark
    Light
  • PDF

This is generated from the built in components of Otter 3.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.

Create File

Creates a file on a server.

Script usage:

Create-File(
	Name: <text>,
	[Text: <text>],
	[Overwrite: <true/false>],
	[FileMode: <text>]
);

This operation may be prefixed with Files::, although this is a built-in namespace and isn't really necessary.

Arguments:

NameFormatScript UsageUsage Notes
File name (default)
text
Name
The path of the file to create. This argument is required.
Text
text
Text
Overwrite
true/false
Overwrite
File mode
text
FileMode
The octal file mode for the file. This value is ignored on Windows.

Example:

# write the name of the current working directory to my desktop
Create-File(
    Name: C:\Users\atripp\Desktop\workingdir.txt,
    Text: $WorkingDirectory
);

Was this article helpful?

What's Next