From: khan@xraylith.wisc.edu (Mumit Khan)
Subject: Re: converting between UNC and NT files names?
11 Dec 1997 13:57:43 -0800
Message-ID: <Pine.LNX.3.96.971211111650.23836A-200000.cygnus.gnu-win32@eh_pc11.xraylith.wisc.edu>
References: <01BD063C.D420B680@rodney.wg.icl.co.uk>
Reply-To: Mumit Khan <khan@xraylith.wisc.edu>
Mime-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1753259445-118504625-881860878=:23836"
To: Kevin Hughes <kh@wg.icl.co.uk>
Cc: "Gnuwin95 (E-mail)" <gnu-win32@cygnus.com>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--1753259445-118504625-881860878=:23836
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.SUN.3.93.971211112529.3577B@modi.xraylith.wisc.edu>

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/


--1753259445-118504625-881860878=:23836
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="pathconv.cc"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.971211112118.23836B@eh_pc11.xraylith.wisc.edu>
Content-Description: posix to win32 path converter

I2luY2x1ZGUgPGlvc3RyZWFtLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQoj
aW5jbHVkZSA8bGltaXRzLmg+CQkvLyBQQVRIX01BWCBzaG91bGQgYmUgaGVy
ZSwgYnV0IGluc3RlYWQNCiNpbmNsdWRlIDxzeXMvcGFyYW0uaD4JCS8vICAg
IGl0IHNlZW1zIHRvIGJlIGhlcmUuDQoNCi8vDQovLyBmcm9tIHBhdGguaCBp
biBjeWd3aW4zMiBkaXN0cmlidXRpb24uDQovLw0KZXh0ZXJuICJDIiB7DQp2
b2lkIGN5Z3dpbjMyX2NvbnZfdG9fd2luMzJfcGF0aCAoY29uc3QgY2hhciAq
c3JjX3BhdGgsIGNoYXIgKndpbjMyX3BhdGgpOw0Kdm9pZCBjeWd3aW4zMl9j
b252X3RvX2Z1bGxfd2luMzJfcGF0aCAoY29uc3QgY2hhciAqc3JjX3BhdGgs
IGNoYXIgKndpbjMyX3BhdGgpOw0KfQ0KDQppbnQgbWFpbiAoaW50IGFyZ2Ms
IGNoYXIqIGFyZ3ZbXSkgew0KICAgIGNoYXIgd2luMzJfZnVsbF9wYXRoIFtQ
QVRIX01BWF07DQogICAgY2hhciB3aW4zMl9wYXRoIFtQQVRIX01BWF07DQog
ICAgZm9yICh1bnNpZ25lZCBpbnQgaSA9IDE7IGkgPCBhcmdjOyArK2kpIHsN
Cgljb25zdCBjaGFyKiBwb3NpeF9wYXRoID0gYXJndltpXTsNCiAgICAgICAg
Y3lnd2luMzJfY29udl90b19mdWxsX3dpbjMyX3BhdGggKHBvc2l4X3BhdGgs
IHdpbjMyX2Z1bGxfcGF0aCk7DQogICAgICAgIGN5Z3dpbjMyX2NvbnZfdG9f
d2luMzJfcGF0aCAocG9zaXhfcGF0aCwgd2luMzJfcGF0aCk7DQoJY2VyciA8
PCBwb3NpeF9wYXRoIDw8ICIgLS0+ICIgPDwgd2luMzJfZnVsbF9wYXRoIA0K
CSAgICA8PCAiICgiIDw8IHdpbjMyX3BhdGggPDwgIikiIDw8IGVuZGw7DQog
ICAgfQ0KICAgIGV4aXQgKDApOw0KfQ0K
--1753259445-118504625-881860878=:23836--
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
