Summary
Returns an object representing one of the standard directories.
Method of
Install object
Syntax
FileSpecObject getFolder ( String FolderName); FileSpecObject getFolder ( String folderName, String subDirectory); FileSpecObject getFolder ( Object localDirSpec, String subDirectory);
Parameters
The getFolder method has the following parameters:
-
folderName
- A string representing one of Netscape's standard directories. There are two sets of possible values for this parameter. The first set contains platform-independent locations; the second set contains platform-specific locations. You are encouraged to use the platform-independent locations. See the list in the Description section for the two sets of locations.
-
subDirectory
- A string that specifies the name of a subdirectory. If the specified subdirectory doesn't exist, it is created. This parameter is available in Netscape 6 or later and may be case sensitive (depending on the operating system).
-
localDirSpec
-
A
FileSpecObject
representing a directory obtained by getComponentFolder or getFolder.
Returns
A FileSpecObject
representing one of Netscape's standard directories, or NULL
in case of error or if subDirectory
refers to a file that already exists.
Description
The getFolder
method obtains an object representing one of Netscape's standard directories, for use with the addFile
and getWinProfile
methods. The value of folderName
must be one of the following (info is based on Mozilla 1.7 stable branch, might also work in other versions):
|
|
|
|
|
The "file:///" form is only valid when the subDirectory
parameter is used. It must be in file: URL format minus the "file:///" part. For example,
mydir = getFolder("file:///", "c|/mysoftco/somedir");
Note that forward slashes are used, regardless of the platform.
The folders whose names start with "Win", "Mac", or "Unix" are specific to those platforms. You should be careful about using one of those directories, as it makes your installation platform-specific.
Example
To get an object representing the standard plug-ins directory, you would use this call:
plugindir = getFolder("Plugins");