1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

opening a file descriptor

Discussion in 'C' started by vin_pll, Nov 24, 2007.

  1. vin_pll

    vin_pll New Member

    Hello all,
    iam working on some project in which i need to open a file descriptor and send it to the streambuf,
    which iam doing like

    Code:
    Code:
    ifstream f(fd);
    streambuf * buf2=f.rdbuf();
    but main problem is that they are casting to

    Code:
    Code:
    ifstream f((const char *)fd)
    streambuf * buf2=f.rdbuf();
    because of which the file is not getting opened ,if i remove that leads to error there are using some conventions

    there are many ways are also there like

    Code:
    Code:
    File *ptr=fdopen(fd);
    which is successfull and returning the value.
    but i want the the output to be given in streambuf which other parts of my project is using,
    can u tell me is there any way to convert the file pointer to the streambuf or is there anyway of reading the file so that the output will result in the streambuf
    with this convention

    Code:
    Code:
    ((const char *)fd)
    please help me.
     

Share This Page