Ext.WriteTextFile()

(SBM On-Premise only) Writes the string contents to the file referred to by string fileName, overwriting the file's previous contents.

Function Signature

 Variant Ext.WriteTextFile( fileName, contents )

Parameters

Parameter Type Description

fileName

string

Specifies a fully-qualified path and file name. The fileName can be any valid file path, including a path to a network device.

Note: This function may fail due to permissions settings. Verify that accounts that will execute the script have permission to write to the destination file.

contents

Variant

The value to be written to the file.

Return

Type Description

Variant

Returns the string parameter "contents".

Technical Details

SBM ModScript version: 11.3.

Notes

The file is opened, written, and closed; if it doesn't exist, it is created first. Concurrent scripts cannot access the file for reading or writing until this write operation finishes. To append to a file's contents rather than overwrite them, refer to Ext.AppendTextFile().

Related Topics

Extension Functions