Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2006-04-11 14:38:00

Peter Dimov wrote:
> std::ifstream is( "" );
> std::ofstream os( "" );
> os << is.rdbuf();
> No proposal required, in principle.

Are you aware of (a) ambiguity and (b) potential security hole?

> mkdir http:
> mkdir http:/
> touch http:/
> file empty

If you replace the first line with something more generic, for example
     std::ifstream is( argv[1] );

it becomes unclear that the code might send requests to the net.

This can be resolved by additional checks appied to argv[1] or, better
yet, with a second agrument to ifstream's ctor that specfify a
domain/protofol (local, net, http, ftp and so on).

Alexander Nasonov
Project Manager

Boost list run by bdawes at, gregod at, cpdaniel at, john at