Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Win32 API for determining if a path is relative or absolute?

Is there a win32 function that will tell me if a path is relative or absolute?

Thanks,

like image 902
twk Avatar asked May 12 '09 14:05

twk


2 Answers

As jeffamaphone said: You can use the Shlwapi function PathIsRelative() to determine of a given path is relative or absolute.

But I thought I'd add that you can easily convert a Relative Path to an Absolute Path using _fullpath(), and from an Absolute Path to a Relative Path using PathRelativePathTo().

Hope this helps!

like image 185
NTDLS Avatar answered Nov 16 '22 00:11

NTDLS


PathIsRelative()

like image 20
i_am_jorf Avatar answered Nov 15 '22 22:11

i_am_jorf