FileSystemObject.CreateTextFile()

JScript2.0+syntax

							filesystemobject.CreateTextFile(filename, overwrite)

Description

The CreateTextFile() method is used to create a new text file. This method takes two parameters. The first parameter, filename, is a string specifying the name of the file to create, while the second parameter, overwrite, is a Boolean value indicating whether to overwrite an existing file.

Example

Listing 9.74 shows how to use the CreateTextFile() method. An instance of the FileSystemObject is created, which in turn uses the CreateTextFile() method to create the file testing.txt.

Listing 9.74 Example of CreateTextFile()
 <html> <body> <script language="JScript"> <!-- Hide // function creates a new text file called "testing.txt" ...

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.