--- In [email protected], [EMAIL PROTECTED] wrote: > > > Hi guys, > > need a little help from you UNIX experts. I should help a > friend of mine to port a little application from Unix to > Windows. This application reads from three terminals the > user input and writes messages. I googled a bit finding: > Windows implementation of POSIX, CygWin and some other > stuff out on the net but I'm getting more confused!
No wonder: 1) Windows is NOT conformant to POSIX; there are loads of POSIX functions missing, and others don't work as supposed with additional effort (e.g. fread(), readdir(), and many, many more). 2) CygWin emulates a Unix environment under Windows. 3) Most important: the programming models of character-based applications simply don't apply to Windows. > Can someone explain me: > - what does this 'KeyStrokeAscii' do? > - why and how does 'gets(...)' get input from the terminal? It reads stdin. And BTW it's dangerous and unsafe to the bone; one of the oldest security breaches in IT history. Totally unsafe to use. > - why and how does 'printf(...)' print out on the terminal? It writes to stdout. Which under Unix is usually connected to the terminal where the application has been started on. Under Windows there is nothing like stdout. > - under windows, what should I do: simply read and > write chars on the serial port? No: forget the Unix source code and learn to write Windows programs. That's the only really useful way I can think of. The best book on Windows programming I've seen so far is Programming Windows by Charles Petzold, Microsoft Press. I hate to let M$ have a single penny from me, but this book is worth every single cent. Regards, Nico
