File.resetStream()

Note:

The content in this help topic pertains to SuiteScript 2.0.

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.

Important:

To use this method, each line must be less than 10MB.

Returns

void

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/file Module

Since

2017.1

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/file Module Script Samples.

          //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 

        

Related Topics

file.File
N/file Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices