Mail Archives: djgpp-workers/2001/12/27/09:03:32
> > I would need to think about this - we would need to
> recognize UNCs as
> > being driveless and handle specially. You can't CD to them, just
> > open files, do file I/O
>
> It is IMHO a bad idea to disallow chdir on UNC directories: some
> applications depend on that. Important shell scripts, such as
> texi2dvi, and some programs from the TeX-related packages come to
> mind.
Agreed. A DOS 'cd' is impossible, as that never changes 'drives'.
But an NT 'pushd' is possible. Since our 'chdir' is supposed to be
Unixy, 'chdir c:/foo' should be more like pushd (i.e. 'c:; cd /foo'),
and so UNCs should be chdir()able.
> It is also a misfeature in general to have a directory which cannot be
> chdir'ed into. We cannot expect to get away with that.
Well, I suppose we could have stat/fstat not set the 'executable' bit
for
UNC dirs; that indicates you can't chdir into them.
> Perhaps you could look into what Windows programs, such as COMMAND.COM
> or CMD.EXE, do when you type "cd \\cws333\c$\djgpp".
That does nothing (cfr 'cd f:/foo' when you're on c:) with 4NT; cmd.exe
complains that you can't have UNC paths as current directory.
'pushd \\foo\bar' does work though. cmd.exe maps a temporary drive
letter
to the UNC 'drive' and uses that (so 'pushd \\foo\bar puts you on
V:\ or whatever is available). A 'popd' then unmaps the drive. 4NT does
the handling internally and just shows the UNC path. The 4NT behaviour
seems to be the most desirable, but is probably the more complicated of
the two (which is why MS 'wisely' decided not to support it).
- Raw text -