TextStream.Close()

JScript2.0+Syntax

							textstream.Close()

Description

The Close() method of the TextStream object closes the previously opened file.

Example

Listing 9.126 shows you how to open and close a text file. This file can be executed with the Windows Scripting Host (wscript.exe or cscript.exe).

Listing 9.126 Using the Close() Method to Close a Text File
// Create a FileSystemObject object
var myFileSysObj = new ActiveXObject("Scripting.FileSystemObject");

// Create a TextStream object
var myTextStream = myFileSysObj.OpenTextFile("c:\\temp\\test.txt", 1, true);

// Close the stream to the file
myTextStream.Close();
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.