delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/12/11/13:57:43

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: <Pine.LNX.3.96.971211111650.23836A-200000.cygnus.gnu-win32@eh_pc11.xraylith.wisc.edu>
References: <01BD063C DOT D420B680 AT rodney DOT wg DOT icl DOT co DOT uk>
Reply-To: Mumit Khan <khan AT xraylith DOT wisc DOT edu>
Mime-Version: 1.0
To: Kevin Hughes <kh AT wg DOT icl DOT co DOT uk>
Cc: "Gnuwin95 (E-mail)" <gnu-win32 AT cygnus DOT 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 AT docserver DOT cac DOT washington DOT edu for more info.

--1753259445-118504625-881860878=:23836
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine DOT SUN DOT 3 DOT 93 DOT 971211112529 DOT 3577B AT modi DOT xraylith DOT wisc DOT 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 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: <Pine DOT LNX DOT 3 DOT 96 DOT 971211112118 DOT 23836B AT eh_pc11 DOT xraylith DOT wisc DOT edu>
Content-Description: posix to win32 path converter

I2luY2x1ZGUgPGlvc3RyZWFtLmg+DQojaW5jbHVkZSA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QgKDApOw0KfQ0K
--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".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019