getFolder

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):

"Chrome"
"Components"
"Current User"
"Defaults"
"file:///"
"OS Drive"
"Plugins"
"Preferences"
"Profile"
"Program"
"Temporary"

"Mac Apple Menu"
"Mac Control Panel"
"Mac Desktop"
"Mac Documents"
"Mac Extension"
"Mac Fonts"
"Mac Shutdown"
"Mac Startup"
"Mac System"
"Mac Trash"
"Mac Preferences"

"MacOSX Default Download"
"MacOSX Home"
"MacOSX Internet Sites"
"MacOSX Local Applications"
"MacOSX Local Desktop"
"MacOSX Local Documents"
"MacOSX Local Frameworks"
"MacOSX Local Internet PlugIn"
"MacOSX Local Preferences"
"MacOSX Movie Documents"
"MacOSX Music Documents"
"MacOSX Picture Documents"
"MacOSX User Applications"
"MacOSX User Desktop"
"MacOSX User Documents"
"MacOSX User Frameworks"
"MacOSX User Internet PlugIn"
"MacOSX User Preferences"

"Unix Lib"
"Unix Local"

"Windows"
"Win AppData"
"Win Common Files"
"Win Desktop"
"Win Desktop Common"
"Win Program Files"
"Win Programs"
"Win Programs Common"
"Win StartMenu"
"Win StartMenu Common"
"Win Startup"
"Win Startup Common"
"Win System"

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");