
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
706
|
Chapter 12: Filesystem I/O
Discussion
There are three distinct timestamps associated with any directory. These timestamps
are its creation time, its last access time, and its last write time.
In addition to timestamp information, a directory’s attributes may also be obtained
and modified. This is accomplished through the use of the public instance
Attributes
property found on a DirectoryInfo object. This property returns the FileAttributes
enumeration value (see Table 12-9). The FileAttributes enumeration is made up of
bit flags that can be turned on or off through the use of the bitwise operators
&, |, or ^.
In many cases, more than one of these flags may be set at one time. The
Normal flag is
the exception; when this flag is set, no other flag may be set.
See Also
See the “Directory Class,” “DirectoryInfo Class,” and “FileAttributes Enumeration”
topics in the MSDN documentation.
12.12 Renaming a Directory
Problem
You need to rename a directory.
Table 12-9. Definitions of each bit flag in the FileAttributes enumeration
Flag name Definition
Archive Typically, backup applications will use this to indicate the archive status of the file.
Compress The current directory uses compression.
Directory The current item is a directory.
Encrypted The current directory is encrypted.
Hidden The current ...