Message677
Logged In: YES
user_id=305840
I have a related question, I have a project that I am
working on, and I ran into an enormous amount of problems
with file i/o as a result of pythons standard file stuf not
using win32api, what I'm doing to prevent the problem is re-
building python, and my project (embedded into python) but
in rebuilding i have edited fileobject.c to force all file
operation calls to use their win32api counterparts by
defining macros to replace the stdio functions. I.E. fopen
() -> createfile(), ...The macro replacement accepts the
original arguements, converts them as neccessary to the
ones needed by the win32API func, calls the win32api
function and then returns a value which models the behavior
of the original function.
As you may have guessed already this presented some
interesting problems as most of these functions are all
passing around (FILE *) structures. To work around this I
am returning the HANDLE's that these functions return
letting the program pretend that they are FILE *s. I would
have macrod FILE * to be a HANDLE except that one of the
first functions PyFile_AsFile(f) is of type FILE *, and
didnt like that very much.... Finally I had replaced
almost everything..
Currently I am down to 2 last problems, dealing with
fputs(), and that in now in my tracebacks sys.stdout
instead of being an open path to stdout so as to enable
sys.stdout.write('whatever') to write to stdout and thus to
screen, it becomes an error as 'my' file opener i believe
attempts to open a file named stdout.. I havent had much
luck trying to figure what happens in sysmodule, and was
wondering if any one had any ideas comments suggestions or
help to offer. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 13:49:42 | admin | link | issue210821 messages |
| 2007-08-23 13:49:42 | admin | create | |
|