hello MacGyver ,
i think u r the only person who always reply in negetive way,
let others to reply.
hello MacGyver ,
i think u r the only person who always reply in negetive way,
let others to reply.
Others have replied and you have ignored them. If you cannot understand something in a positive light, then perhaps a negative one is needed. And for that matter, I'll reply wherever I wish to, without your permission or blessing.
As to the issue which you are being completely dense about, let me try yet again to make it perfectly clear: There is no platform independant way to do what you are doing outside of writing it multiple ways and incorporating it into a library of your own. In and of itself, you can't do this task with file descriptors and streams for all operating systems. File descriptors are a Unix-based concept. Windows has the same idea conceptually, but they use a generic void * which they typedef as a HANDLE.
There is a reason why you are supposed to use FILE objects in C and file streams in C++. This is to make this entire thing abstract so that you can write your code portably no matter what operating system you're compiling against. Once you wish to go beyond that and delve into OS specific functionality, you have to create a library that supports every target platform you wish to cover. This is your only solution for this problem.
I hope this finally gets the point across to you.
Quite right. Except that there isn't always an abstraction for everything you want to do. In this case, the OP seemed to have a problem where he needed to fit the file descriptor portion of a project that had already been done into another module that expects a streambuf object. What better glue than a derived class that implements the platform specific mechanism and provides the abstract interface for working in portable code? (modulo some error recovery for the sake of demonstration).
I have been known to trumpet the portable mantra myself, and probably too much, but this is an example of how the streams abstraction can be used to solve problems when the parts just don't fit quite right.
Know whud I mean?
I agree with you, however, his very requirements are not portable in nature, and thus require a library of sorts (ie. to be done in each specific manner). This is what I was trying to point out to him.