Mail Archives: djgpp-workers/1997/11/23/08:04:19
On Thu, 20 Nov 1997, Oberhumer Markus wrote:
> else if (strncmp(p, "/dev/", 5) == 0)
> {
> /* new code: map /dev/a/ to a:/ (lowercase directories only) */
> if (p[5] >= 'a' && p[5] <= 'z' && p[6] == '/')
> {
> _farnspokeb(o++, p[5]);
> _farnspokeb(o++, ':');
> path = p + 6;
> space -= 2;
> }
Why only lowercase [a-z]? MS platforms are case-insensitive; I think
it will be confusing to introduce case-sensitivity in such subtle
cases. Somebody somewhere might convert file names to upper case
knowing that it doesn't matter, and will be badly burnt.
> #if 0
> /* disabled code from 971114 which just removes '/dev/' */
> else if (p[5] != 0)
> path = p + 5;
> #endif
Disabling this will break many things. For example, "ls /dev/tty"
will NOT know that /dev/tty is a device. More significantly,
"/dev/clock$" and any other DOS device won't return the S_IFCHR bit
set. This is BAD, IMHO. For example, opening a file whose name is
taken by a device driver will almost always get you into trouble, and
`stat' is the only way to know about the trouble beforehand. The
DJGPP port of `tar' uses this trick to avoid problems when the archive
includes files like `prn.txt' or `/dev/aux.c'.
- Raw text -