AUX File Writing Error

Jean-Paul Calderone exarkun at divmod.com
Thu Feb 15 09:58:12 EST 2007


On Thu, 15 Feb 2007 10:13:17 -0300, Gabriel Genellina <gagsl-py at yahoo.com.ar> wrote:
>En Thu, 15 Feb 2007 03:34:59 -0300, John Machin <sjmachin at lexicon.net>
>escribió:
>
>> On Feb 15, 4:03 pm, thewritersc... at gmail.com wrote:
>>> Is there any way I can create an "AUX.csv" file without the error?
>>
>> Probably not. AUX, CON, NUL, PRN, LPT, COM1, COM2 etc (with or without
>> an extension) are reserved in Windows for specific devices for
>> compatibility with MS-DOS 1.00 programs, which did that for
>> compatibility with CP/M.
>
>(This is OT now) Do you know why "AUX.csv" is invalid too? I can accept
>that AUX (without extension) is an invalid filename, but it is quite
>different from "AUX.csv"
>

Many programs unconditionally add an extension to a filename received
from user input or elsewhere.  To "simplify" dealing with files, the
open call accounts for this case, assuming that the program did not
really want to open a file on disk, but that it just accidentally added
an extension where one was not really necessary.

There /is/ a way to open an on-disk file named "AUX" or "AUX.csv", but
it requires special spelling.  I don't remember the details at present,
but presumably if you are interested you can dig it up on MSDN.

Jean-Paul




More information about the Python-list mailing list