Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

_fullpath vs GetFullPathName

Tags:

c

winapi

What is the difference between: _fullpath and GetFullPathName

Of course I mean compare their ANSI/Unicode variants separatly

  • Ansi: _fullpath vs GetFullPathNameA
  • Uni: _wfullpath vs GetFullPathNameW

It seems that _fullpath has much nicer and simpler API as it allows to allocate the buffer for you but I just think if I replace GetFullPathNameW with _wfullpath what would I miss?

like image 517
Artyom Avatar asked Nov 13 '22 18:11

Artyom


1 Answers

You wouldn't necessary miss anything. In fact, it's quite possible that _fullpath() calls GetFullPathName(). In that case, _fullpath() works like a sort of wrapper for GetFullPathName(), which would explain why the interface seems a little simpler and easier to use.

You simply have multiple ways to accomplish the same task. And, as long as either method is not obsolete and performs the task needed, the choice is entirely up to you.

like image 160
Jonathan Wood Avatar answered Dec 31 '22 21:12

Jonathan Wood