Re: File I/O using NASM in 32-bit mode



On Fri, 07 Jul 2006 18:08:08 +0200, "¬a\\/b" <al@xxx> wrote:
when in windows 95 if i write in stdin
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa<cntr-Z>"
and my buf in stdin is 4 chars
and in the end of prog i close(stdin);

when i start a new programs seems its stdin has "aaaaaaaaaaa"
so it is not flush

Can you give a more detailed example of how this happens? Also, are you
talking about the C FILE* stdin, or are you talking about the win32
STD_INPUT_HANDLE?

it seems in windows95 something like
char buf[10];
int len=4, var;
in = GetStdHandle( STD_INPUT_HANDLE )
if(in==-1) return 0;
WriteFile(in, buf, len, &var, 0);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
CloseHandle(in);

better if ReadFile(in, buf, len, &var, 0);
i hate remember names or procedure i think if all goes right i will
remember only printf* getline, "<<" ">>" ostream istream sstream and
all assembly
.



Relevant Pages

  • Re: File I/O using NASM in 32-bit mode
    ... when in windows 95 if i write in stdin ... and my buf in stdin is 4 chars ... WriteFile(in, buf, len, &var, 0); ...
    (alt.lang.asm)
  • Re: File I/O using NASM in 32-bit mode
    ... when in windows 95 if i write in stdin ... and my buf in stdin is 4 chars ... and in the end of prog i close; ...
    (alt.lang.asm)
  • Re: HLA Lib
    ... understand skipping over blank chars in typed input, ... I think you should also provide some routine to read stdin even ...
    (alt.lang.asm)
  • Re: sizeof(str) or sizeof(str) - 1 ?
    ... 'string' is neither a variable nor a type. ... This will copy the six chars of name into buf and fill the remaining 250 ... 'preserve the NUL terminator' question. ...
    (comp.lang.c)
  • Re: Trying to toss input with non-printable characters
    ... > I'm trying to write a tiny script that reads its stdin and, ... > the input line has above a particular threshold of characters ... # Drop lines containing too many bad chars in a row ...
    (comp.lang.tcl)