CHAPTER 20 FILE I/O AND OBJECT SERIALIZATION
Figure 20-1. The File- and Directory-centric types
FileInfo and DirectoryInfo typically serve as better choices for obtaining full details of a file or
directory (e.g., time created, or read/write capabilities) because their members tend to return strongly
typed objects. In contrast, the Directory and File class members tend to return simple string values
rather than strongly typed objects. This is only a guidline however; in many cases, you can get the same
work done using File/FileInfo or Directory/DirectoryInfo.
The Abstract FileSystemInfo Base Class
The DirectoryInfo and FileInfo types receive many behaviors from the abstract FileSystemInfo base
class. For the most part, you use the members of the FileSystemInfo class to discover general
characteristics (such as time of creation, various attributes, and so forth) about a given file or directory.
Table 20-2 lists some core properties of interest.
Table 20-2. FileSystemInfo Properties
Property
Meaning in Life
Attributes
Gets or sets the attribut