Need help with C file streams

  • Thread starter Thread starter sfx1999
  • Start date Start date
Status
Not open for further replies.
Yes DragonZap, I did intialize it, but it still crashed.

Anyway, look what I found while looking through stdio.h:

Code: [Select]
Code:
/* * The structure underlying the FILE type. * * I still believe that nobody in their right mind should make use of the * internals of this structure. Provided by Pedro A. Aranda Gutiirrez * <[email protected]>. */
 
Anyway, look what I found while looking through stdio.h:

Code: [Select]
Code:
/* * The structure underlying the FILE type. * * I still believe that nobody in their right mind should make use of the * internals of this structure. Provided by Pedro A. Aranda Gutiirrez * <[email protected]>. */

You see what I mean, then. Any library that doesn't allow any flexibility/abstraction in where it gets its data from is probably one you want to avoid.
 
Cyb: could you post some example how to use those streams this way ? And how to cast them to FILE* ?
Short answer NO ;)

Hehehe you can't cast a stream object to a FILE structure or visa versa.  It is a nonsequiter thing to do.  For sfx1999 he should have no problem making a simple stream memory object he should be able to use streams as well.  MingW is not just C it's C++ as well.

Are you trying to do image manipulation under Linux? You might be better off using the PBM library functions for that, and use pipe redirection to dump your internal memory data in and out for handling the image. Essentially you end up with two applications your main program feeding the data to the filter and the filter processing the data and returning it on stdout.  It's much easier to do under Linux than windows, and more importantly under Linux they can operate simultaneously.

Cyb
 
Mwahaha! I've just located a feature in the new version of Corona that allows me to create a fake file. Score!
 
Mwahaha! I've just located a feature in the new version of Corona that allows me to create a fake file. Score!
Gouda.. err good ;) Well glad you found a way to get from point A to point B without going through a bunch of pointless points! :)

Cyb
 
Oh and mirex, let me explain how they did it. They created their own object to deal with file stream. You could probably use a file stream to create an object and have the read function check if the file is in memory or on the disk, and use fread and such. This would not involve looking at the FILE data at all.
 
Status
Not open for further replies.
Back
Top