Macro test() ; just to ensure I use the exact same call
GetFullPathName_( *file, 1000, *full, #NUL )
EndMacro
*file = @"test.txt"
*full= AllocateMemory(1000)
result=0
; This works:
test() ; test w/o using the result
Debug test() ; show the result.
Debug "Now trying to assign it to a variable"
result = test() ; this fails with either debugger crashing or "overflow of dynamic memory"
Debug "Now trying to assign it to a variable"
result = test() ; this fails with either debugger crashing or "overflow of dynamic memory"
Debug "DEBUG: " + PeekS(*full, result) ; my addition
Just because it worked doesn't mean it works. PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
jassing wrote: Sat May 11, 2024 1:24 am
....
What if the file is elsewhere in the path?
Well, I only read the article on MSDN (...learn.microsoft....) about the function and I came to the conclusion that it always works with the current directory.
Here's a small collection (pasted from MSDN):
GetFullPathName merges the name of the current drive and directory with a specified file name to determine the full path and file name of a specified file.
....
This function does not verify that the resulting path and file name are valid, or that they see an existing file on the associated volume.
....
Relative paths passed to the GetFullPathName function are interpreted as relative to the process's current directory.
....
Applications should be aware that consecutive calls to the GetFullPathName function with a relative path may produce different results if the current directory changes between the two calls.
Just because it worked doesn't mean it works. PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).