|
Methods for working with files.
| Method |
Description |
CopyFile(source, destination, overwrite) |
Copies the from source to destination. |
CreateTextFile(name, overwrite, unicode) |
Creates a new text file with specified name. If overwrite parameter
is set to True, any existing file with the same name is overwritten. |
DeleteFile(name, force) |
Deletes the file with specified name. |
FileExists(name) |
Returns True if file exists and False if not. |
GetBaseName(path) |
Returns name of the file from the specified path. |
GetExtensionName(name) |
Returns extension of the given file. |
GetFile(name) |
Returns a File object of the file name specified. |
GetFileName(pathandname) |
Returns only name of the file. |
GetTempName() |
Returns a randomly generated temporary file name. |
MoveFile(source, destination) |
Moves the file from source to destination. |
OpenTextFile(name, iomode, create, format) |
Opens a file and returns TextStream object. iomode can be
ForReading(1), ForWriting(2) or ForAppending(8). Default
is ForReading(1). If create is set to True then a new
file will be created if file with given name is not found. |
Properties of Drive Object
Properties of Drive.
| Property |
Description |
AvailableSpace |
Returns amount of space available to this user on this drive. |
DriveLetter |
Returns drive letter. |
DriveType |
Returns type of drive which may be Unknown(0), Removable(1), Fixed(2),
Network(3), CD-ROM(4) or RamDisk(5). |
FileSystem |
Returns type of file system on the drive. |
FreeSpace |
Returns amount of free space available on the drive. |
IsReady |
Returns True if drive is ready else False. |
Path |
Returns path of the drive. |
RootFolder |
Returns root Folder object for the drive. |
SerialNumber |
Returns serial number for the drive. |
ShareName |
Returns network share name if it is a network drive. |
TotalSize |
Returns total size in bytes of the drive. |
VolumeName |
Sets or returns volume name for the drive. |
There are no methods associated with Drive object.
Properties and Methods of Folder Object
Properties of Folder.
| Property |
Description |
Attributes |
Returns attributes for the folder which may be Normal(0), ReadOnly(1),
Hidden(2), System(4), Volume(name)(8), Directory(folder)(16), Archive(32),
Alias(64) or Compressed(128). |
DateCreated |
Returns date and time when folder was created. |
DateLastAccessed |
Returns date and time when folder was last accessed. |
DateLastModified |
Returns date and time when folder was last modified. |
Drive |
Returns drive letter of the drive where folder exists. |
Files |
Returns a Files collection of all the files present under that
folder. |
IsRootFolder |
Returns True if current folder is root folder for the drive else
returns False. |
Name |
Returns name of the folder. |
ParentFolder |
Returns Folder object for the parent folder. |
Path |
Returns complete path for the folder. |
ShortName |
Returns DOS style 8.3 version of folder name. |
ShortPath |
Returns DOS style 8.3 version of folder path. |
Size |
Returns size of the folder in bytes. |
SubFolders |
Returns a collection of Folder objects present under the current
folder. |
Type |
Returns a descriptive string for the current folder. |
Methods of Folder.
| Method |
Description |
Copy(destination, overwrite) |
Copies all the files and sub folders of current folder to destination. |
Delete(force) |
Deletes the current folder. |
Move(destination) |
Moves the folder to destination. |
CreateTextFile(name, overwrite, unicode) |
Creates a new text file under the current folder. If overwrite argument is
True then existing file with same name is deleted. unicode
argument is optional. |
Methods for working with files.
| Method |
Description |
CopyFile(source, destination, overwrite) |
Copies the from source to destination. |
CreateTextFile(name, overwrite, unicode) |
Creates a new text file with specified name. If overwrite parameter
is set to True, any existing file with the same name is overwritten. |
DeleteFile(name, force) |
Deletes the file with specified name. |
FileExists(name) |
Returns True if file exists and False if not. |
GetBaseName(path) |
Returns name of the file from the specified path. |
GetExtensionName(name) |
Returns extension of the given file. |
GetFile(name) |
Returns a File object of the file name specified. |
GetFileName(pathandname) |
Returns only name of the file. |
GetTempName() |
Returns a randomly generated temporary file name. |
MoveFile(source, destination) |
Moves the file from source to destination. |
OpenTextFile(name, iomode, create, format) |
Opens a file and returns TextStream object. iomode can be
ForReading(1), ForWriting(2) or ForAppending(8). Default
is ForReading(1). If create is set to True then a new
file will be created if file with given name is not found. |
Properties of Drive Object
Properties of Drive.
| Property |
Description |
AvailableSpace |
Returns amount of space available to this user on this drive. |
DriveLetter |
Returns drive letter. |
DriveType |
Returns type of drive which may be Unknown(0), Removable(1), Fixed(2),
Network(3), CD-ROM(4) or RamDisk(5). |
FileSystem |
Returns type of file system on the drive. |
FreeSpace |
Returns amount of free space available on the drive. |
IsReady |
Returns True if drive is ready else False. |
Path |
Returns path of the drive. |
RootFolder |
Returns root Folder object for the drive. |
SerialNumber |
Returns serial number for the drive. |
ShareName |
Returns network share name if it is a network drive. |
TotalSize |
Returns total size in bytes of the drive. |
VolumeName |
Sets or returns volume name for the drive. |
There are no methods associated with Drive object.
Properties and Methods of Folder Object
Properties of Folder.
| Property |
Description |
Attributes |
Returns attributes for the folder which may be Normal(0), ReadOnly(1),
Hidden(2), System(4), Volume(name)(8), Directory(folder)(16), Archive(32),
Alias(64) or Compressed(128). |
DateCreated |
Returns date and time when folder was created. |
DateLastAccessed |
Returns date and time when folder was last accessed. |
DateLastModified |
Returns date and time when folder was last modified. |
Drive |
Returns drive letter of the drive where folder exists. |
Files |
Returns a Files collection of all the files present under that
folder. |
IsRootFolder |
Returns True if current folder is root folder for the drive else
returns False. |
Name |
Returns name of the folder. |
ParentFolder |
Returns Folder object for the parent folder. |
Path |
Returns complete path for the folder. |
ShortName |
Returns DOS style 8.3 version of folder name. |
ShortPath |
Returns DOS style 8.3 version of folder path. |
Size |
Returns size of the folder in bytes. |
SubFolders |
Returns a collection of Folder objects present under the current
folder. |
Type |
Returns a descriptive string for the current folder. |
Methods of Folder.
| Method |
Description |
Copy(destination, overwrite) |
Copies all the files and sub folders of current folder to destination. |
Delete(force) |
Deletes the current folder. |
Move(destination) |
Moves the folder to destination. |
CreateTextFile(name, overwrite, unicode) |
Creates a new text file under the current folder. If overwrite argument is
True then existing file with same name is deleted. unicode
argument is optional. |
|