Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-03

TProcess input/ouput handles

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen

Hi,

How can I close the input pipe of a process ? Suppose it keeps processing until EOF, then I have to close to handle to let it finish its job.

Micha

Reply by email

Michael Van Canneyt
to Micha Nelissen
Micha Nelissen wrote
Hi, How can I close the input pipe of a process ? Suppose it keeps processing until EOF, then I have to close to handle to let it finish its job.

sysutils.fileclose(input.handle)

Michael.

Reply by email

Micha Nelissen
to Michael Van Canneyt
Show quoted text 10 lines
On Wed, 29 Mar 2006, Micha Nelissen wrote: > Hi, > > How can I close the input pipe of a process ? Suppose it keeps processing > until EOF, then I have to close to handle to let it finish its job. sysutils.fileclose(input.handle)

Won't the handle be closed again by TProcess then ? Might that not lead to closing of another opened file handle ?

Micha

Reply by email

Michael Van Canneyt
to Micha Nelissen
Micha Nelissen wrote 16 lines
On Thu, 30 Mar 2006 09:23:39 +0200 (Romance Daylight Time) Michael Van Canneyt wrote: > > > On Wed, 29 Mar 2006, Micha Nelissen wrote: > >> Hi, >> >> How can I close the input pipe of a process ? Suppose it keeps processing >> until EOF, then I have to close to handle to let it finish its job. > > sysutils.fileclose(input.handle) Won't the handle be closed again by TProcess then ? Might that not lead to closing of another opened file handle ?

It might. In fact, it probably will :)

The problem is that you cannot do a input.free, because this will not zero the stream pointer, causing an access violation when TProcess is freed...

Michael.

Reply by email