ssCore.FileSys.writeToFile

Writes data to a text file in a single operation.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

path - A fully qualified path to the file you want to write. This parameter supports monikers.

data - Data to be written.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.FileSys.writeToFile( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.FileSys.writeToFile( paramsObject );


Notes:

You can't use this function to create binary files, just text files.

If the specified file does not exist it will be created. FileSys.writeToFile will not create folders that are part of the path, so the target directory must exist (see FileSys.createDir).

All data in the specified file will be lost. You can use FileSys.appendToFile to add data to a text file that already exists.

                

Examples:

ssCore.FileSys.writeToFile({path:"startdir://file.txt", data:"Hello"});