The OpenD Programming Language

writablePath

Get writable path for specific location.

  1. string writablePath(StandardPath type, FolderFlag params)
    nothrow @safe
    string
    writablePath
  2. string writablePath(StandardPath type, string subfolder, FolderFlag params)

Parameters

type StandardPath

Location to lookup.

params FolderFlag

Union of FolderFlags. Note: This function does not cache its results.

Return Value

Type: string

Path where files of type should be written to by current user, or an empty string if could not determine path.

Examples

string downloadsDir = writablePath(StandardPath.downloads, FolderFlag.verify);
if (downloadsDir.length) {
    //Open file dialog with this directory.
} else {
    //Could not detect default downloads directory.
    //Ask user to choose default downloads directory for this application.
}

See Also

Meta