Language Reference |
See Also Applies To
Creates a specified file name and returns a TextStream object that can be used to read from or write to the file.
object.CreateTextFile(filename[, overwrite[, unicode]])
The CreateTextFile method has these parts:
Part Description object Required. Always the name of a FileSystemObject or Folder object. filename Required. String expression that identifies the file to create. overwrite Optional. Boolean value that indicates whether you can overwrite an existing file. The value is true if the file can be overwritten, false if it can't be overwritten. If omitted, existing files are not overwritten. unicode Optional. Boolean value that indicates whether the file is created as a Unicode or ASCII file. The value is true if the file is created as a Unicode file, false if it's created as an ASCII file. If omitted, an ASCII file is assumed.
The following code illustrates how to use the CreateTextFile method to create and open a text file:If the overwrite argument is false, or is not provided, for a filename that already exists, an error occurs.var fs = new ActiveXObject("Scripting.FileSystemObject"); var a = fs.CreateTextFile("c:\testfile.txt", true); a.WriteLine("This is a test."); a.Close();
© 1997 by Microsoft Corporation. All rights reserved.
|file: /Techref/inet/iis/jscript/htm/js254.htm, 3KB, , updated: 2005/6/21 09:58, local time: 2018/3/18 04:28,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/inet/iis/jscript/htm/js254.htm"> CreateTextFile Method</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180318 RussellMc, Isaac M. Bavaresco, Sean Breheny, Neil, Van Horn, David, David C Brown, alan.b.pearce, Bob Blick, John Gardner, Brent Brown,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!