Re: [fpc-pascal] EOF on stdin

2007-12-09 Thread Mark Morgan Lloyd
Tomas Hajny wrote: I'm trying to distinguish between a case where there is no parameter on the command line and where there is piped input. For unix one can simply use termio.isatty(input) I think. Note that you could use function Do_IsDevice provided in system unit for this (if Input is

Re: [fpc-pascal] EOF on stdin

2007-12-09 Thread Tomas Hajny
On 8 Dec 07, at 13:20, Mark Morgan Lloyd wrote: > Good grief- that was quick :-) > > Marco van de Voort wrote: > >> I'm trying to distinguish between a case where there is no parameter on > >> the > >> command line and where there is piped input. The code below works under > >> Win-32 > >> bu

Re: [fpc-pascal] EOF on stdin

2007-12-08 Thread Mark Morgan Lloyd
Marco van de Voort wrote: For unix one can simply use termio.isatty(input) I think. I can confirm that that works. Another implementation difference that I noticed between Win-32 and Linux was that FileExists() on Win-32 excludes directories while on Linux it matches them. Workaround was t

Re: [fpc-pascal] EOF on stdin

2007-12-08 Thread Mark Morgan Lloyd
Good grief- that was quick :-) Marco van de Voort wrote: I'm trying to distinguish between a case where there is no parameter on the command line and where there is piped input. The code below works under Win-32 but under Linux Eof() waits for input: If I start it under linux by piping an eo

Re: [fpc-pascal] EOF on stdin

2007-12-08 Thread Marco van de Voort
> I'm trying to distinguish between a case where there is no parameter on the > command line and where there is piped input. The code below works under > Win-32 > but under Linux Eof() waits for input: > >IF ParamCount = 0 THEN BEGIN (* Case (1) or (2) *) > debug('No para

[fpc-pascal] EOF on stdin

2007-12-08 Thread Mark Morgan Lloyd
I'm trying to distinguish between a case where there is no parameter on the command line and where there is piped input. The code below works under Win-32 but under Linux Eof() waits for input: IF ParamCount = 0 THEN BEGIN (* Case (1) or (2) *) debug('No parameters (case 1 or 2)'