Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
dir := extractfilepath(paramstr(0));
$dir = realpath(dirname(__FILE__));
dir = __dir__
dir = AppDomain.CurrentDomain.BaseDirectory;
dir = arg[1]
let dir = std::env::current_exe()?
.canonicalize()
.expect("the current exe should exist")
.parent()
.expect("the current exe should be a file")
.to_string_lossy()
.to_owned();
const dir = __dirname;