char *dir = getcwd(NULL, 0);
interface
function c_getcwd (buf, size) bind(C,name="getcwd") result(r)
import
type(c_ptr) :: r
character(kind=c_char), dimension(*), intent(out) :: buf
integer(kind=c_size_t), value :: size
end function c_getcwd
end interface
if (c_associated(c_getcwd (buf, size(buf,kind=c_size_t)))) then
n = findloc(buf,achar(0),1)
allocate (character(len=n-1) :: dir)
dir(1:n-1) = transfer(buf(1:n-1),dir(1:n-1))
end if
dir <- getCurrentDirectory
String dir = System.getProperty("user.dir");
String dir = new File("").getAbsolutePath();
dir = os.getenv("PWD") or io.popen("cd"):read()
dir = Dir.pwd
Dir : String := Current_Directory;
char *dir = getcwd(NULL, 0);
dir = std::filesystem::current_path();
string path = Directory.GetCurrentDirectory();
string dir = absolutePath;
interface function c_getcwd (buf, size) bind(C,name="getcwd") result(r) import type(c_ptr) :: r character(kind=c_char), dimension(*), intent(out) :: buf integer(kind=c_size_t), value :: size end function c_getcwd end interface if (c_associated(c_getcwd (buf, size(buf,kind=c_size_t)))) then n = findloc(buf,achar(0),1) allocate (character(len=n-1) :: dir) dir(1:n-1) = transfer(buf(1:n-1),dir(1:n-1)) end if
dir, err := os.Getwd()
def dir = new File('.').absolutePath
dir <- getCurrentDirectory
let dir = process.cwd ()
String dir = System.getProperty("user.dir");
String dir = new File("").getAbsolutePath();
String path = this.getClass().getClassLoader().getResource("").getPath();
dir = os.getenv("PWD") or io.popen("cd"):read()
$dir = getcwd();
dir := expandfilename('.');
my $dir = getcwd();
dir = os.getcwd()
let dir = env::current_dir().unwrap();