I take no credit for this. This is ts-soft's code that I found in the Feature Requests forum, but too many people are still looking for it.
Code: Select all
Procedure.s GetCurrentDir()
Protected CurDir.s
CurDir.s = Space(2048)
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
getcwd_(CurDir, 2048)
CompilerElse
GetCurrentDirectory_(2048,CurDir)
CompilerEndIf
ProcedureReturn CurDir
EndProcedure
Debug GetCurrentDir()