hlogmans
28th May 2004 11:36 UTC
Possible bug in GetFullPathname
Hi all,
I seem to have a problem on win98 with the function GetFullpathname. If i add a filename that does not exist, it returns an empty string. This is different than what is mentioned in the help:
Assign to the user variable $x, the full path of the file specified. If the path portion of the parameter is not found, the error flag will be set and $x will be empty. If /SHORT is specified, the path is converted to the short filename form.
kichik
28th May 2004 11:42 UTC
As you quoted yourself:
$x will be empty
What's the problem?
hlogmans
28th May 2004 12:08 UTC
Originally posted by kichik
As you quoted yourself:What's the problem?
The path is empty even if the path exists. The function DOES return the path if i omit the file-part. The help states that only the path needs to exist. I use if for the DLL upgrade macro to get a short path to a file, but now i need to remove the file-portion first.
Thanks for the quick reply!
Joel
28th May 2004 14:25 UTC
Well, maybe this is not your awnser, but the GetFullPathName is the same as msdn's.
You'll need some files installed, they call them Microsoft Layer for Unicode on Windows 95/98/Me Systems.
kichik
28th May 2004 14:59 UTC
I'll try to find out what the documentation is referring to.
deguix
28th May 2004 22:32 UTC
The function DOES return the path if i omit the file-part.
Maybe he is trying to say something I said in a recent post (if you didn't read it), GetFullPathName doesn't return totally the full name. Example:
"C:\PROGRA~1\COMMON~1"
Will return
"C:\PROGRA~1\Common Files"
And the Windows original GetFullPathName does return the correct folder name.
The bug is in front of you now, kichik. Just say when it's fixed.
hlogmans
31st May 2004 19:38 UTC
Originally posted by Lobo Lunar
Well, maybe this is not your awnser, but the GetFullPathName is the same as msdn's.
This link resolves it: msdn states the FILE must exist (a folder is a file). So it fails if the file does not exist, which is exactly what happened. So my conclusion is that the helpitem is not entirely true, or just confusing. It tries to say the same, but it isn't. The helpfile makes you believe you can get the fullpathname of a theoretically existing file if the destination folder exists (which is true for the updatedll macro), but this is obviousely not true.
Maybe it won't be a bad idea at all to include links to the MSDN pages in the helpdocs if those functions are used (on the other side, who wants to write docs at all... If i suggest this, i probably would get 50 invitations to help write the docs :) ).