Re: VFAT: Can't create file named 'aux.h'?

From: Randy.Dunlap
Date: Tue Mar 21 2006 - 00:20:35 EST


On Mon, 20 Mar 2006 23:28:19 -0500 Phillip Susi wrote:

> Why on earth does linux enforce this restriction? I'm not sure about dos ( it has been 10+ years since I used it ), but NT will happily create files with those names on either fat or ntfs, provided that you refer to them with an absolute path name. Seeing as how it wasn't really a restriction on the filesystem itself, but rather the fact that those names were predefined by io.sys, I see no reason why linux should prevent you from using them.

The only reason that I could come close to seeing is backwards
compatibility: moving a disk+filesystem back to a real DOS
environment. But that's just not very likely...


> Randy.Dunlap wrote:
> > "AUX" is (was) a reserved "filename" in DOS. The Linux MS-DOS
> > filesystem preserves (protects) that. The extension part does not
> > matter; it only checks the first 8 characters of the filename.
> > You'll need to use a different filesystem or filename...
> >
> >
> > fs/msdos/namei.c:
> >
> > for (reserved = reserved_names; *reserved; reserved++)
> > if (!strncmp(res, *reserved, 8))
> > return -EINVAL;
> >
> > /* MS-DOS "device special files" */
> > static const unsigned char *reserved_names[] = {
> > "CON ", "PRN ", "NUL ", "AUX ",
> > "LPT1 ", "LPT2 ", "LPT3 ", "LPT4 ",
> > "COM1 ", "COM2 ", "COM3 ", "COM4 ",
> > NULL
> > };

---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/