From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: converting between UNC and NT files names? 11 Dec 1997 13:57:43 -0800 Message-ID: References: <01BD063C DOT D420B680 AT rodney DOT wg DOT icl DOT co DOT uk> Reply-To: Mumit Khan Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1753259445-118504625-881860878=:23836" To: Kevin Hughes Cc: "Gnuwin95 (E-mail)" 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 AT docserver DOT cac DOT washington DOT edu for more info. --1753259445-118504625-881860878=:23836 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: 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 AT xraylith DOT wisc DOT 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: 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 AT cygnus DOT com" with one line of text: "help".