writablePath

Evaluate writable path for specific location and append subfolder. This can be used with StandardPath.config and StandardPath.data to retrieve folder specific for this application instead of generic path.

Parameters

type StandardPath

Location to lookup.

subfolder string

Subfolder that will be appended to base writable path.

params FolderFlag

Union of FolderFlags. This affects both base path and sub path. Note: This function does not cache its results.

Return Value

Type: string

Path where files of $(U type) should be written to by current user concatenated with subfolder, or an empty string if could not determine path.

Examples

enum organizationName = "MyLittleCompany";
enum applicationName = "MyLittleApplication";

string configDir = writablePath(StandardPath.config, buildPath(organizationName, applicationName), FolderFlag.create);
if (configDir.length) {
    string configFile = buildPath(configDir, "config.conf");
    //read or write configuration file.
} else {
    throw new Exception("Could not create application config directory");
}

Meta