Properties
A long integer containing a bit mask that represents the file system attributes of the
directory.
Access: Read/Write
Default: None
Notes: This property contains various file system attributes for the
directory represented as a bit mask. Boolean operations can be used to test and set
specific attributes using the constants defined in the table below.
| Constant |
Value |
Description |
| AF_ATTRIBUTE_READONLY |
1 |
The directory is read only. |
| AF_ATTRIBUTE_HIDDEN |
2 |
The directory is a hidden
directory. |
| AF_ATTRIBUTE_SYSTEM |
4 |
The directory is a system
directory. |
| AF_ATTRIBUTE_DIRECTORY |
16 |
This is a directory (always set
and read-only) |
| AF_ATTRIBUTE_ARCHIVE |
32 |
The directory has the archive
attribute set. |
| AF_ATTRIBUTE_COMPRESSED |
2048 |
The directory is compressed
(NTFS only and read-only). |
The bit for attribute AF_ATTRIBUTE_DIRECTORY is always set and can not be changed.
Furthermore, the bit for attribute AF_ATTRIBUTE_COMPRESSED can not be modified.
Example 1: The following example shows how to test to see if the
directory is compressed:
' Code showing initialization of the Directory object omitted
If Dir.Attributes And AF_ATTRIBUTE_COMPRESSED Then
Response.Write "Directory is compressed.<BR>"
Else
Response.Write "Directory is not compressed.<BR>"
End If
Example 2: The following example shows how to set the archive
attribute for a directory:
' Code showing initialization of the Directory object omitted
Dir.Attributes = Dir.Attributes Or AF_ATTRIBUTE_ARCHIVE
See Also: File object
String value of the mask for building the directory object.
Access: Read/Write
Default: "*.*"
Notes: The Mask property is useful for limiting the files that show up
in the Files collection to those that are of interest.
Example: The following example shows how to set the Mask property to
limit the Files collection to only text files:
' Code showing initialization of the Directory object omitted
Dir.Mask = "*.txt"
See Also: Files collection
String value representing the owner of the directory (NTFS only). This may be a group
or a user.
Access: Read/Write
Default: None
Notes: This property can be useful for displaying the owner of the
directory. While it can also be used to take ownership of directory, you must be
logged in under the same account that you are trying to set this property to and that
account must have permission to take ownership of the directory. For more information see Security Considerations.
Example 1: The following example shows how to display the owner of a
directory:
' Code showing initialization of the Directory object omitted
Response.Write "Owner = " & Dir.Owner & "<BR>"
Example 2: The following example shows how to take ownership of a
directory:
' Code showing initialization of the Directory object omitted
Dir.Owner = "sam"
See Also: Security
Considerations
String value of the path to the folder or
directory.
Access: Read/Write
Default: None
Notes: Path is the default property of the Directory object
representing the path of the directory being
referenced. Because this is the default property the following are equivalent:
Path = Directory.Path
Path = Directory
This property is automatically set by the Create
and CreateTemp methods to the path of the
directory that was just created.
While you can set the Path property to point to an existing directory, modifying the
Path property will not cause the directory to be renamed. If you want to rename a
directory, use the Rename method.
Example: The following example shows how to display the path of the
directory:
' Code showing initialization of the Post object omitted
Response.Write "Path = " & Dir & "<BR>"
See Also: Directory.Create method, Directory.CreateTemp method, Directory.Rename
method
Variant value specifying the File property to use for sorting the Files
collection as shown by the following table.
Access: Read/Write
Default: 0 (sort by FileName)
Notes: The Sort property is useful for sorting the contents of a
directory that you wish to display by setting the property to one of the following
constants:
Files are always sorted in ascending order. If you need the files sorted in a
descending order, simply access the collection in reverse order.
Example: The following example shows how to sort the directory by file
size:
' Code showing initialization of the Directory object omitted
Dir.SortOrder = AF_SORT_SIZE
See Also: File object, Files
collection
|