Boost logo

Boost :

From: Jon Biggar (jon_at_[hidden])
Date: 2003-07-18 19:34:11


Eugene Lazutkin wrote:
> I have a few comments in no particular order.
>
> 1) I cannot imaging someone programming in C++ and using "FILE*s,and file
> descriptors" instead of iostream & Co. You've must be talking about
> incomplete systems like embedded systems, which don't have complete standard
> C++ library. Are there any real life examples for that? How frequent are
> they?

Imagine again. :)

For example, on UNIX, to securely create a file, you need to use the
O_CREAT and O_EXCL flags to ensure that nobody else created the file
first and is just waiting for you to write to it so they can read what
you wrote. (There are other ways of circumventing naive security that
are similar.)

The C++ I/O library does not give the programmer the ability to set
those flags, so raw file descriptors or FILE * (using fdopen()) are the
only solution to the problem.

Another possibility is interfacing to a legacy C library.

Another example is UNIX sockets network programming.

-- 
Jon Biggar
Floorboard Software
jon_at_[hidden]
jon_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk