risby
Programmer
- Feb 27, 2002
- 84
Hi peeps
About a decade ago I wrote
inputStream was NULL unless a filename had been specified on the command line. The attach() function that was available with that compiler nearly a decade ago, when I wrote it, allowed me to use this program as part of a pipeline.
I think that's a fairly standard requirement for Unix programs so I'm hoping someone will have implemented this idea somehow with a more recent compiler. It seems the attach() function was an extension that today's standard don't have.
Cheers
==========================================
I phoned the local ramblers club today, and this bloke just went on and on.
About a decade ago I wrote
Code:
ifstream fin;
if (NULL == inputStream)
{
fin.attach(0);
inputStream = "stdin";
}
else
{
fin.open(inputStream, ios::in);
}
I think that's a fairly standard requirement for Unix programs so I'm hoping someone will have implemented this idea somehow with a more recent compiler. It seems the attach() function was an extension that today's standard don't have.
Cheers
==========================================