Mail Archives: djgpp/1998/05/05/06:05:55
>
> On Tue, 5 May 1998, Thomas Demmer wrote:
>
> > Hmm, this can easily fail on a redirected network drive.
> > Under Novell, I can do nasty things as
> >
> > MAP ROOT i:=usr:home/demmer/djgpp
> > MAP ROOT k:=usr:home/demmer/djgpp/bin
> > cp i:/bin/gcc.exe k:/gcc.exe
> >
> > and end up with a nuked gcc.exe, because both names refer to the
> > same file. stat() will happily report both of them being
> > different files, when in fact they are the same. IIRC, stat()
> > keeps track of filenames on a drive level to invent inodes.
>
> Did you actually try this? If so, I would like to hear the results.
These commands
MAP ROOT L:=i:\demmer
MAP ROOT K:=i:\demmer\tmp
K:
cp turboc.cfg l:/tmp
yield:
No warning,
turboc.cfg truncated to length zero.
cp --v
cp - GNU Fileutils-3.13
Hmm, is this still up to date?
However,
copy turboc.cfg l:\tmp
gives the error
File cannot be copied to itself.
>
> As far as I know, on DOS and Windows 3.X, the above would correctly tell
> you that these files are the same, because `_truename' resolves both names
> to the same UNC, and thus both files get the same inode and the same
> st_dev number. The same situation exists with SUBST and JOIN, and `stat'
> does handles those correctly.
I can confirm this. Both say
\\BRAIN1\USR\HOME\DEMMER\TMP\TURBOC.CFG
>
>
> The only place where this does break is on Windows 9X (surprise,
> surprise!). It turns out that Windows doesn't care to return a UNC for
> drives mapped to other machines in the workgroup, so you get the same
> X:\foo back, even if X: is actually mapped to \\TOM_DEMMER\SHARE\LIB. I
> had an experimental version of `stat' which tried to resolve this by
> fetching the network name of X:, but then I found out that in some cases
> this doesn't work either, so I abandoned the idea, for now.
>
> > The concept of drive letters is so brain-dead that it hurts,
> > but what can you do?
>
> First, you can avoid mapping different drive letters to the same disk on
> the same machine. (Remember that "don't do that" joke?)
I do know what I am doing (read: I can sometimes figure out what went
wrong when I didn't know what I was doing), but some of the users
here cannot.
>
> And second, you could yell at Microsoft gods to return the UNC like we
> all expect.
>
I admire your faith. Did that _ever_ help? ;-)
And third, switch to a working OS.
Ciao
Tom
******************************************************************
* Thomas Demmer * Phone : +49 234 700 6434 *
* Universitaetsstr. 150 * Fax : +49 234 709 4162 *
* Lehrstuhl fuer Stroemungsmechanik * *
* D-44780 Bochum * *
******************************************************************
* Email: demmer AT LStM DOT Ruhr-Uni-Bochum DOT De *
* WWW: http://www.lstm.ruhr-uni-bochum.de/~demmer *
******************************************************************
Naeser's Law: You can make it foolproof, but you can't make it
damnfoolproof.
- Raw text -