Archive: Possible bug in GetFullPathname


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.


As you quoted yourself:

$x will be empty
What's the problem?

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!

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.


I'll try to find out what the documentation is referring to.


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.

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 :) ).