The Folder Object | |
The Folder object provides access to the folders on a drive |
Attributes | |
Property | |
Returns the attributes of the folder. Can be a combination of any of the values: Normal (0), ReadOnly (1), Hidden (2), System (4), Volume (name) (8), Directory (folder) (16), Archive (32), Alias (64) and Compressed (128). |
DateCreated | |
Property | |
Returns the date and time that the folder was created. |
DateLastAccessed | |
Property | |
Returns the date and time that the folder was last accessed. |
DateLastModified | |
Property | |
Returns the date and time that the folder was last modified. |
Drive | |
Property | |
Returns the drive letter of the drive on which the folder resides. |
Files | |
Property |
|
Returns a Files collection containing File objects representing all the files within this folder. |
IsRootFolder | |
Property | |
Returns a Boolean value indicating if the folder is the root folder of the current drive. |
Name | |
Property | |
Sets or returns the name of the folder. |
ParentFolder | |
Property | |
Returns the Folder object for the parent folder of this folder. |
Path | |
Property | |
Returns the absolute path of the folder using long file names where appropriate. |
ShortName | |
Property | |
Returns the DOS-style 8.3 version of the folder name. |
ShortPath | |
Property | |
Returns the DOS-style 8.3 version of the absolute path of this folder. |
Size | |
Property | |
Returns the size of all files and subfolders contained in the folder. |
SubFolders | |
Property | |
Returns a Folders collection consisting of all folders contained in the folder, including hidden and system folders. |
Type | |
Property | |
Returns a string that is a description of the folder type (such as "Recycle Bin") if available. |
Copy(destination,overwrite) | |
Method | |
Copies this folder and all its contents to the folder specified in destination, including all the files contained in this folder. If destination ends with a path separator character ('\') then destination is assumed to be a folder into which the copied folder will be placed, otherwise it is assumed to be a full path and name for a new folder to be created. An error will occur if the destination folder already exists and the optional overwrite parameter is set to False. The default for overwrite is True. |
CreateTextFile(filename,overwrite,unicode) | |
Method | |
Creates a new text file within this folder with the specified filename and returns a TextStream object that refers to it. If the optional overwrite parameter is set to True any existing file with the same name will be overwritten. The default for overwrite is False. If the optional unicode parameter is set to True, the content of the file will be stored as Unicoded text. The default for unicode is False. |
Delete(force) | |
Method | |
Deletes this folder and all its contents. If the optional force parameter is set to True, the folder will be deleted even if the read-only attribute is set on it or on any contained files. The default for force is False. |
Move(destination) | |
Method | |
Moves this folder and all its contents to the folder specified in destination. If destination ends with a path separator character ('\') then destination is assumed to be the folder in which to place the moved folder, otherwise it is assumed to be a full path and name for a new folder. An error will occur if the destination folder already exists. |