Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > FileWriter > open

FileWriter.open() method

Opens a new file handle to the file at the specified path and given mode. Behind the scenes it uses fs.openSync(). The behaviour of this function is platform specific. See: https://nodejs.org/docs/latest-v8.x/api/fs.html\#fs\_fs\_open\_path\_flags\_mode\_callback

Signature:

static open(filePath: string, flags?: IFileWriterFlags): FileWriter;

Parameters

ParameterTypeDescription
filePathstringThe absolute or relative path to the file handle that should be opened.
flagsIFileWriterFlags(Optional) The flags for opening the handle

Returns:

FileWriter