Modules

filter

 

Objects/Functions

module (N/file)

SuiteScript 2.0

File.resetStream()

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=File.resetStream() for more information.

N/file Module
File.resetStream()
Method Description: Method used to reset the file contents. Serves as an undo action on any unsaved content written with File.appendLine(options) or File.lines.iterator(). Use this method to reset the reading and writing streams that may have been opened by File.appendLine(options) or File.lines.iterator(). The line pointer (or read iterator) is also set to its previous state. This method can be used on text or .csv files. To use this method, each line must be less than 10MB.
Returns: Void
Supported Script Types: Server-side scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/file Module
Since: 2017.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=File.resetStream()

Example:

// Code Example 1
//Add additional code
//...
var afile = file.create({
name: 'tmp3.txt',
fileType: 'PLAINTEXT',
contents:'one line'
});
afile. appendLine({
value:'line two'
});
afile.resetStream();
afile.lines(function f(){});
//...

//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4769955125.html