isatty and Pavel stream.d

Carlos Smith carlos-smith at sympatico.ca
Fri May 1 08:52:52 PDT 2009


"Jarrett Billingsley" <jarrett.billingsley at gmail.com> a écrit dans le 
message de >
> extern(C) int isatty(int);
>
> And you should be able to use it.  You shouldn't get any linking
> errors, at least I don't think.

It worked fine.no link error.

isatty is sometimes used like this: isatty(fileno(fp))
So i used fileno(), whis is declared in std.c.stdio.
but i got a linking error:
    _fileno not found.

I tried two other function in std.c.stdio to see if
this was causes by some other factor i am not awared of.

clearerr() and rewind() works just fine.

So may be there is a problem with fileno() ??

> You mean std.stream?  That's been part of Phobos .. well, forever. 
> At
> least 5 years anyway.

No, i mean the stream.d that comes in stream.zip from the
Pavel's site: http://int19h.tamb.ru/files/stream.zip
His stream library seems different. as, it have functions to
read Unicode strings from the console. I tried to compile
it with dmd 1.043 but there are many errors.

>
>> This library seems to allow reading utf-8 from a windows console.
>>
>> With dmd 1.043, it's very easy to write utf string to console. But, 
>> how do
>> we readln from the console ?
>

>> std.stdio.readln

I know that function. But it allows to read
char[] arrays only. (if i read well the declarations).

How do i read wchar[] arrays from the console with it ?

As i said, it's real easy to write unicode strings
to the console. But, it seems a lot less easier
to read unicode from the console.

Am i right ?



More information about the Digitalmars-d-learn mailing list