Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are alternatives to the GetShortPathName function?

Tags:

c++

c

winapi

I'm looking for a function which can return the 'short' (8.3 notation) path for a given 'long' path. However, the GetShortPathName function (which seemed like a perfect fit) doesn't work for me since it requires thata file with the given long path exists already.

What other options do I have for computing the 8.3 path for a given long path?

like image 958
Frerich Raabe Avatar asked Dec 12 '22 20:12

Frerich Raabe


1 Answers

If the file does not exist, it does not have an 8.3 name. The 8.3 name is created when the file is created. You can of course get the 8.3 pathname for the directory it's in using GetShortPathName on the directory itself, if you need that.

Regardless, this is 2010. It's really backwards to be using 8.3 names for anything.

like image 53
R.. GitHub STOP HELPING ICE Avatar answered Dec 28 '22 18:12

R.. GitHub STOP HELPING ICE