From: kommer@artefaktur.com (=?Windows-1252?Q?Roger_Ren=E9_Kommer?=)
Subject: DOS <-> Unix filenames
4 Jan 1999 21:17:39 -0800
Message-ID: <000001be37ee$0292c5b0$fb01a8c0.cygnus.gnu-win32@rrkommer.com>
Reply-To: <roger@isp.uni-kassel.de>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
To: <gnu-win32@cygnus.com>

Hi,

I like to instrument bash, sed, etc. to manage my NT Server.

A common problem is, that in scripts that uses gygwin and NT command
line utilities I have to covert the filenames from NT to cygwin
and vice versa.

Sample:

//e/d/cxx/aproject <-> e:\d\cxx\aproject
/usr/local/myfiles <-> d:\unixfs\usr\local\myfiles
/cdrom/x/file      <-> x:\file
../dir/output       <-> .\dir\output

What I need is a (two) utilities which can convert these filenames
ufn2dfn [u]nix[f]ile[n]ame2[d]os[f]ile[n]ame
and
dfn2ufn [d]os[f]ile[n]ame2[u]nix[f]ile[n]ame

ufilelist="//e/d/cxx/aproject /usr/local/myfiles /cdrom/x/file ./dir/output"
for i in $ufilelist; do
	a_ntutility `ufn2dfn "$i"`
done

dfn2ufn is quite simple and can done with a few sed calls.
ufn2dfn is a little more complicated, because it has to evaluate the mount
table.

If I didn't overlook a simpler solution I would suggest to integrate this
into the cygwin package. Alternatively it can be integrated into the ls or
mount command.

With RFC and regards,
Roger Rene Kommer
kommer@artefaktur.com






-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
