www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/05/21/15:15:09

From: ian AT cygnus DOT com (Ian Lance Taylor)
Subject: pathconv
21 May 1998 15:15:09 -0700 :
Message-ID: <199805212213.SAA22693.cygnus.cygwin32.developers@subrogation.cygnus.com>
To: cygwin32-developers AT cygnus DOT com

I'd like to write a shell utility to help convert file and path names
between win32 and POSIX format.  Being able to convert a POSIX path to
win32 format isconvenient when invoking win32 programs from shell
scripts.  Doing the reverse conversion seems natural as well.

I propose that the program be named pathconv.

Usage: pathconv [-p|--path] (-u|--unix)|(-w|--windows) filename\n\
  -u|--unix     print Unix form of filename\n\
  -w|--windows  print Windows form of filename\n\
  -p|--path     filename argument is a path\n",

Some proposed examples:

% pathconv -u c:/foo.txt
//c/foo.txt
% pathconv -w //c/foo.txt
c:\foo.txt
% pathconv -w c:\foo.txt
c:\foo.txt
% pathconv -p -u /a:/b
/a:/b
% pathconv -p -u \a;\b
/a:/b
% pathconv -p -w /a:/b
\a;\b
% pathconv -p -w /a;/b
\a;\b

This utility would simply call the existing path conversion functions
in the cygwin32 DLL.

Does anybody have any comments on this?  Perhaps a better name, or a
better syntax?

Ian

- Raw text -


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