May 2004
Intermediate to advanced
888 pages
22h 31m
English
Like the Directory and DirectoryInfo classes, File and FileInfo classes exist in the System.IO namespace that provide the functionality for manipulating files. Because the directory and file classes descend from the same base class, they contain some of the same properties, and using them is almost identical.
There are more than a few ways to create a file. One is to use the File.CreateText() method to create a text file. This method returns a StreamWriter that allows you to write to the file. This technique is illustrated here:
var sw: StreamWriter; begin if not System.IO.File.Exists('c:\deleteme.txt') then begin sw := System.IO.File.CreateText('c:\deleteme.txt'); try sw.Write('hello world'); finally ...Read now
Unlock full access