Originally Posted by
Codeplug
Are you sure the first read() isn't returning 0?
gg
I made the following modifications to the above code.
Code:
out = open("file.out", O_CREAT, S_IWUSR|S_IRUSR);
len = read(0, &buffer, 128);
write(1, " value for len is " , 64);
write(1, &len, 2);
do {
write(out, &buffer, len);
} while((len = read(0, &buffer, 128)) >= 128 );
after compiling the new code I get the following output which is definatly ODD... please advice...
Code:
Hi how are you>?
value for len is $@þÿÿ@øþÿÿxXÿÿÿ