See below ...
Joe.
> -----Original Message-----
> From: Clarence Verge [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, 26 February 2001 12:23
> To: [EMAIL PROTECTED]
> Subject: Re: Closing the can
>
> da Silva, Joe wrote:
> >
> > It's good that we have now arrived at the same point, and
> > we are all happy that TSR's should close STDOUT, just
> > in case this is being redirected ... :-)
> >
> > Incidentally, regarding your function $09 vs. file I/O example,
> > (title : Re: STDOUT (and other special files)), am I naive to
> > think you can "have the best of both worlds", using func. $09
> > to write to STDOUT, then simply "closing" file handle 1
> > (STDOUT)? I don't see why not ... ;-)
>
> I don't see what good closing an unused handle will do. ;-)
>
[da Silva, Joe]
Well, I'll presume you are just joking, here ... <g>
> > Perhaps it's just my HLL perspective, but it seems that I
> > don't understand what is meant here by "inheritance". We
> > both know that any files opened by the parent remain open
> > while the child is exec'ed, but this "inheritance" stuff seems
> > to imply rather _more_ than that. We also both know that the
> > special file handles such as STDOUT are available to all,
> > but again, I don't think that is what is being said here. So,
> > exactly what does "inheritance" mean ... ? :-/
>
> DOS acts as the lawyer here. <G>
>
> When the application launches the child by EXEC, DOS gives the child ALL
> the file properties that the parent had as long as the parent didn't
> specifically say NO to some things/files. In addition, of course,
> the child can get all the properties that the parent had "inherited"
> from DOS, again, as long as the parent doesn't say "NO".
> The INT21fun3D (Open file handle) actually has an "inherit" bit, which
> when set to 1 makes that file private to the parent.
>
[da Silva, Joe]
Yes, that's what I understood, in general terms, from
what you were saying, and from those references you
quoted. But what does that mean specifically, for the
child process? In other words, how does this "fit in"
with a standard application, which simply says to DOS,
"I want to open file 'ABC.XYZ', in Write mode", when
said application is exec'ed by another? Or does the child
application do something different, instead, to access
a file that the parent has already "opened for it"? As I
said, my perspective is HLL, so for me an application
simply tries to open a file in whichever mode it needs,
and then DOS either obliges or else tells the application
to "take a hike" ...
> And, I think it is also possible for the parent to forbid the child access
> to STDOUT by simply re-directing STDOUT to the bit bucket via a dummy
> handle.
> That would be INT21fun46 to force a duplicate handle to a file.
> Of course, I suppose the child can use the same method to re-direct it
> back
> to CON: if it can figure out what the dummy handle was. <G>
> A lot like real life here.
>
> The word "inherit" no doubt is a result of choosing the names "parent"
> and "child" for the processes we are talking about.
>
> - Clarence Verge
> --
> - Help stamp out FATWARE. As a start visit: http://home.arachne.cz/
> --