converting between UNC and NT files names?

Mumit Khan khan@xraylith.wisc.edu
Thu Dec 11 09:25:00 GMT 1997


On Thu, 11 Dec 1997, Kevin Hughes wrote:

> Is there any easy way of converting between the unc used by the gnu tools for file names and the standard
> NT file names? I would like to call native NT tools directly from shell scripts but all the file names I have
> in variables etc. are in UNC format and the tools only understand the standard names.
> 

The attached piece of code may help you get started. Simply run it with
the posix filename(s) on the command line and it'll spit out both relative
and absolute win32 pathnames.

   % posix2win32path . //server/src
   . --> c:\tmp (.)
   //server/src --> \\server\src (\\server\src)

Regards, 
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/



More information about the Cygwin mailing list