ofstream constructor doesn't take file descriptor as an argument.
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > ofstream constructor doesn't take file descriptor as an argument.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    ofstream constructor doesn't take file descriptor as an argument.  
Anoop Kumar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

Hi

I have RH Linux 9.0 installed on my x86 computer.
The GCC version is 3.3.2 and the gdb version is 6.0.

I am porting an application from solaris to linux.
The solaris application makes use of such a statement :

ofstream (fd ); where fd is a file descriptor.

This somehow seems to be working in solaris. But when i compile
the program in linux , it gives the following error.

initializing argument 1 of `std::basic_ofstream<_CharT,
_Traits>::basic_ofstream(const char*, std::_Ios_Openmode) [with _CharT =
char, _Traits = std::char_traits<char>]'

1) Is there a work around to this problem???
If so, please do let me know.

- Thanks
Anoop





[ Post a follow-up to this message ]



    Re: ofstream constructor doesn't take file descriptor as an argument.  
Nils O. examnotes


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

In article <31fe3fb2.0401050250.5deb550f@posting.google.com>, Anoop Kumar wrote:
quote:
> Hi > > I have RH Linux 9.0 installed on my x86 computer. > The GCC version is 3.3.2 and the gdb version is 6.0. > > I am porting an application from solaris to linux. > The solaris application makes use of such a statement : > > ofstream (fd ); where fd is a file descriptor. > > This somehow seems to be working in solaris. But when i compile > the program in linux , it gives the following error. > > initializing argument 1 of `std::basic_ofstream<_CharT, > _Traits>::basic_ofstream(const char*, std::_Ios_Openmode) [with _CharT = > char, _Traits = std::char_traits<char>]' > > 1) Is there a work around to this problem??? > If so, please do let me know.
iirc ostream can take a streambuf ,and you should be able to make a strambuf based on a file descriptor. -- Vennlig hilsen/Best Regards Nils Olav Selåsdal <NOS at Utel.no> System Engineer UtelSystems a/s




[ Post a follow-up to this message ]



    Re: ofstream constructor doesn't take file descriptor as an argument.  
Anoop Kumar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

noselasd@frisurf.no (Nils O. Selåsdal) wrote in message news:<slrnbvih3j.vkl.noselasd@utelsystems.
dyndns.org>...
quote:
> In article <31fe3fb2.0401050250.5deb550f@posting.google.com>, Anoop Kumar wrote: > iirc ostream can take a streambuf ,and you should be able to make a stramb uf > based on a file descriptor.
---------------------------------------------------------------------------- ---- Hi, How do i do that??? Could you explain the technique ??? what all functions do i need to override, inorder to perform that???? - Thanks Anoop




[ Post a follow-up to this message ]



    Re: ofstream constructor doesn't take file descriptor as an argument.  
Maurizio Loreti


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

anoop_kn@yahoo.com (Anoop Kumar) writes:
quote:
> How do i do that???
The complete example in in Josuttis, page 672 ff. Go to toe book site, and download the example files io/outbuf2.hpp, io/outbuf2.cpp, io/outbuf3.hpp . -- Maurizio Loreti [url]http://www.pd.infn.it/~loreti/mlo.html[/ur l] Dept. of Physics, Univ. of Padova, Italy ROT13: [email]ybergv@cq.vasa.vg[/emai l]




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:27 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register