On Mar 21, 4:04 pm, Ross Ridge <[EMAIL PROTECTED]> wrote: > Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >You can get the file descriptor from the Python file object using its > >fileno() method. The file descriptor lives at the OS level, so it's safe > >to pass around. > > Not under Windows. Windows doesn't have Unix-like descriptors, so the > C runtime emulates them.
I am trying the following... any thoughts? %typemap(in) FILE * { if (!PyFile_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a file!"); return NULL; } %#ifdef __MINGW32__ PyFileObject *fo = (PyFileObject *)$input; $1 = fdopen(_fileno(fo->f_fp),PyString_AsString(fo->f_mode)); fprintf(stderr,"FDOPEN(%d,\"%s\")\n",fo->f_fp,PyString_AsString(fo- >f_mode)); %#else $1 = PyFile_AsFile($input); %#endif } -- http://mail.python.org/mailman/listinfo/python-list