Page 1 of 1
GetFullPathName
Posted: Wed Jul 30, 2003 4:20 pm
by netmon
Code: Select all
OpenConsole()
;PathBuffer.s = "" ; uncomment this and the full path works ???
PathBuffer = AllocateMemory(0,255,0) ;this does not work for some ???reason
FileName$ = "client.db"
OpenLibrary(0,"kernel32.dll")
result.w = CallFunction(0,"GetFullPathNameA", FileName$,255,@PathBuffer,NULL)
PrintN("String Count: "+Str(result))
PrintN("File path is: "+PeekS(@PathBuffer,result))
Input()
CloseLibrary(0)
CloseConsole()
End
Posted: Wed Jul 30, 2003 7:28 pm
by Paul
Wouldn't it be easier to do this...
Code: Select all
Buffer$=Space(512)
FileName$="client.db"
GetFullPathName_(FileName$,Len(Buffer$),@Buffer$,@FilePart)
Debug PeekS(Buffer$)
Debug PeekS(FilePart)
Posted: Wed Jul 30, 2003 10:36 pm
by netmon
After I did it, I realized this and didnt feal like updating lol.. but yes that is actually.
Posted: Mon Aug 31, 2009 2:26 pm
by Andre
Anyone have a MacOS-compatible solution? Thanks

Posted: Mon Aug 31, 2009 5:01 pm
by WilliamL
@Andre
This has been discussed several times with several solutions.
http://www.purebasic.fr/english/viewtopic.php?t=38495