Subject: DOS <-> Unix filenames
From: [email-masked] (Roger René Kommer)

4 Jan 1999 21:17:39 -0800
Message-ID: <[email-masked]>
Reply-To: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
To: <[email-masked]>

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
[email-masked]

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".