PyString to FILE * ? 
Author Message
 PyString to FILE * ?

I'm writing a python wrapper around a C library that reads from a FILE *
stream.  I'd like to be able to pass in strings from Python as the data to
be read, and in C, convert the strings to a FILE *.

According to the Gnu libc info pages, the appropriate function is
fmemcopy() defined in stdio.h -- however this seems to be missing from
mine (stock RedHat 6.2).

How else might I accomplish PyString --> FILE * conversion?

thanks,
Rick



Thu, 22 May 2003 13:21:53 GMT  
 PyString to FILE * ?

Quote:

> I'm writing a python wrapper around a C library that reads from a FILE *
> stream.  I'd like to be able to pass in strings from Python as the data to
> be read, and in C, convert the strings to a FILE *.

> According to the Gnu libc info pages, the appropriate function is
> fmemcopy() defined in stdio.h -- however this seems to be missing from
> mine (stock RedHat 6.2).

> How else might I accomplish PyString --> FILE * conversion?

Write it out to a file in /tmp?  That's probably the only vaguely
portable way.

HTH,
M.

--
  please realize that the Common  Lisp community is more than 40
  years old.  collectively, the community has already been where
  every clueless newbie  will be going for the next three years.  
  so relax, please.                     -- Erik Naggum, comp.lang.lisp



Thu, 22 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PyArg_BuildValue, how to return a PyString object?

2. File Conversion with File Manager on Huge files

3. DOS File Lookup - just the file name, not the path AND file name

4. How can I know the .EXE file name, file date, file size

5. files, temp files, and file-like objects

6. (VA 4.02b) using long file names for Envy file attachments

7. Comparing 2 files to create a third file

8. searching one file using the contents of another file

9. Parsing CSV file outputting desired information into multiple unique files

10. Substituting :: for __ in every htm file, and rename htlml file

11. newbie would like to break input file and output to separate files

12. Merge selected columns from two different files into another file

 

 
Powered by phpBB® Forum Software