The File System object is used to access the files
and folders of the server.
Methods BuildPath(path, name) appends name onto path,
fixing the path separator if necessary.
CopyFile source, destination, overwrite copies
the file specified by source to destination.
If there is already a file by the same name in the destination,
and overwrite is True, the file is overwritten. If it
is false, the file will not be overwritten.
CopyFolder source, destination, overwrite copies
the folder specified by source to destination.
If there is already a folder by the same name in the
destination, and overwrite is True, the file is overwritten.
If it is false, the file will not be overwritten.
CreateFolder(foldername) creates
a folder.
CreateTextFile(filename, overwrite, unicode) creates
a text file and returns the TextStream object for it. overwrite is
an optional Boolean value that indicates if the file
should be overwritten, if it already exists. True indicates
the file should be overwritten, False indicates
it should not. The default value is False. unicode is
an optional Boolean value that indicates whether the
file is created as Unicode or ASCII. True indicates
Unicode, False indicates
ASCII. The default is False.
DeleteFile(path, force) deletes
the file(s) specified by path. path may
contain a wildcard character at the end. force is
an optional parameter that is set to True to
force read-only files to be deleted.
DeleteFolder(path, force) deletes
the folder(s) specified by path and
their contents. path may
contain a wildcard character at the end. force is
an optional parameter that is set to True to
force read-only folders to be deleted.
DriveExists(path) returns
a Boolean value indicating whether the drive specified
by path exists.
FileExists(path) returns
a Boolean value indicating whether the file specified
by path exists.
FolderExists(path) returns
a Boolean value indicating whether the folder specified
by path exists.
GetAbsolutePathName(pathspec) returns
a complete path given a specification. For example,
if pathspec is "c:",
it returns the full path to the current directory on
the c drive. If it is "c:..",
it would return the parent of the current folder.
GetBaseName(path) returns
the base (no extension) of the filename pointed to by path.
GetDrive(path) returns
the Drive object for the drive containing path.
GetDriveName(path) returns
a string containing the name of the drive for path.
GetExtensionName(path) returns
the extension of the file specified by path.
GetFile(path) returns
the File object corresponding to the file specified
by path.
GetFileName(path) returns
the last filename or folder of path.
For example, GetFileName("c:\Inetpub\wwwroot\default.asp") would
return "default.asp".
GetFolder(path) returns
the Folder object corresponding to the folder specified
by path.
GetParentFolderName(path) returns
a string containing the parent folder of the file or
folder specified by path.
GetSpecialFolder(spec) returns
the path to the specified special folder. spec can
have one of three values: WindowsFolder,
SystemFolder, TemporaryFolder. These constants
have the values 0,
1, 2 respectively. With these, you can get the
path to the server's Windows directory, system directory,
or temporary directory.
MoveFile source, destination moves
the file specified by source to destination.
MoveFolder source, destination moves
the folder specified by source to destination.
OpenTextFile(filename, iomode, create, format) returns
an instance of the TextStream object corresponding to filename. iomode specifies
whether the file should be opened for reading (1), for
writing (2). or for appending (8). create indicates
whether to create the file if it does not already exist.
If format is
-1, it opens the file as Unicode. If it is 0, it opens
it as ASCII. If format is
-2, the file is opened according to the system default.
Collections
Drives contains
all the drive objects available on the machine. |