On Feb 15, 4:03 pm, [EMAIL PROTECTED] wrote:
> Hi guys!
>
> I'm new to python so please be aware that I'm probably missing the
> obvious. Here's my problem...
>
> >>> t = "AUX"
> >>> f = open('c:\\' + t + '.csv', 'a')
>
> Traceback (most recent call last):
>   File "<pyshell#37>", line 1, in <module>
>     f = open('c:\\' + t + '.csv', 'a')
> IOError: [Errno 2] No such file or directory: 'c:\\AUX.csv'
>
> >>> t = "A"
> >>> f = open('c:\\' + t + '.csv', 'a')
>
> As you can see python has no problem opening a file when t = "A", but
> not when it is "AUX" (no "A.csv" or "AUX.csv" exists on the C:\ folder
> prior to when these are run).
>
> 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.

HTH,
John

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to