Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi - Comparing two pathnames when one is UNC and one is drive letter-specified

I have a situation where a user can specify two separate pathnames, and I need to check whether one pathname is "inside" the other one. I can do this if both pathnames are UNC, or both are drive-letter-based, but what if they are mixed?

Can you "normalise" a path such as "C:\Program Files" to "\\[this computer name]\C\Program Files"? Obviously, I can't go the other way, as a network folder in UNC format may not have a corresponding drive letter mapped to it.

like image 447
rossmcm Avatar asked May 05 '12 04:05

rossmcm


1 Answers

Have a look at ExpandUNCFileName function.

like image 79
kludg Avatar answered Sep 30 '22 14:09

kludg