Import std.os.folders
std.os.folders
Folders, where the OS keeps the user's things and the program's, each where that OS's own apps keep them; and OpenDefault, which opens a file, a folder, or a URL in the app the OS opens it with.
std/os/folders.fb
Types
Folders
struct
Public Struct Folders
Folders' Static Properties, each a folder's path, or Null when the OS doesn't say.
-
The program's own file.
-
The user's home folder.
-
Where programs keep the user's settings: Windows' roaming AppData, macOS's ~/Library/Application Support, or Linux's XDG_CONFIG_HOME, ~/.config by default. A program keeps its own in a folder of its name there.
-
Where programs keep the user's data: Windows' roaming AppData, macOS's ~/Library/Application Support, or Linux's XDG_DATA_HOME, ~/.local/share by default.
-
Where programs keep what they can make again: Windows' local AppData, macOS's ~/Library/Caches, or Linux's XDG_CACHE_HOME, ~/.cache by default.
-
Where programs keep files for a while: the first of TMPDIR, TMP, TEMP, and TEMPDIR that's set, or /tmp, on Linux and macOS, and of TMP, TEMP, and USERPROFILE, or the Windows folder, on Windows.
-
The user's documents: Windows' Documents, macOS's ~/Documents, or the one Linux's user-dirs.dirs names, ~/Documents by default.
Functions
OpenDefault
function
Public Function OpenDefault(target: String) Throws IOError
Opens target, a file, a folder, or a URL like "https://futureblitz.dev", in the app the OS
opens it with, and returns once the OS has taken it. Throws an IOError when target is neither
a URL nor a file or folder that's there (NOT_FOUND), when the program may not open it
(PERMISSION_DENIED), or when no app opens it (OTHER).
Report an issue with this page or with FutureBlitz on GitHub.