1. Folder object
The RootFolder attribute of the Driver object returns a Folder object through which all content in the drive can be accessed. You can use the properties and methods of this Folder object to traverse the directory on the drive and obtain the properties of this Folder and other folders.
(1) attributes of the Folder object
The Folder object provides a set of attributes to get more information about the current Folder. You can also change the Folder name. The attributes and descriptions are shown in Table 5-9:
Table 5-9 attributes and descriptions of the Folder object
Genus
Description
Attributes
Returns the properties of the folder. It can be one of the following values or its combination: Normal (0), ReadOnly (1), Hidden (2), System (4), Volume (name) (8) directory (folder) (16), Archive (32), Alias (64), and Compressed (128 ). For example, for a hidden read-only file, the value of Attributes is 3.
DateCreated
Returns the creation date and time of the folder.
DateLastAccessed
Returns the date and time of the last access to the folder.
DateLastModified
Returns the date and time when the folder was last modified.
Drive
Returns the drive letter of the drive where the folder is located.
Files
Returns the Files set contained in the Folder object, indicating all Files in the Folder.
IsRootFolder
Returns a boolean value indicating whether the folder is the root folder of the current drive.
Name
Set or return the folder name
ParentFolder
Returns the Folder object corresponding to the parent Folder of the Folder.
Path
Returns the absolute path of the folder and uses the corresponding long file name.
ShortName
Returns the DOS-style 8.3 folder name.
Export path
Returns the absolute path of the DOS-style 8.3 folder.
Size
Returns the size of all files and subfolders in the folder.
SubFolers
Returns the Folders set corresponding to all subfolders in the folder, including hidden Folders and system Folders.
Type
If possible, return the description string of a folder (for example, "Recycle Bin ")
(2) method of Folder object
The Folder object provides a set of methods for copying, deleting, and moving the current Folder. These methods run in the same way as the CopyFolder, DeleFolder, and MoveFolder methods of the FileSystemObject object, but these methods do not require the source parameter because the source file is the folder. These methods and descriptions are shown in Table 5-10:
Table 5-10 Folder object methods and descriptions
Method
Description
Copy (destination, overwrite)
Copy the folder and all contents to the folder specified by destination. If destination ends with a path separator (''), destination is considered to be a folder for storing the copy folder. Otherwise, destination is the path and name of the new folder to be created. If the target folder already exists and the overwrite parameter is set to False, an error is generated. The default overwrite parameter is True.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service