Sender: brozzis AT mag00 DOT cedi DOT unipr DOT it Message-Id: <33575C14.33CE@mag00.cedi.unipr.it> Date: Fri, 18 Apr 1997 13:33:40 +0200 From: Stefano Brozzi Mime-Version: 1.0 To: djgpp AT delorie DOT com Subject: Was: JPEG. Probs Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Ok, I've upgraded grep, and now it works correctly and get all Ctrl-Z. But my programs still freeze up expecting something at STDIN. BCC works fine with Ctrl-C, Ctrl-Z. Debugging with RHIDE it locks at fread() (quite obviously :) As always stated I've created the shortest amount of code that reproduces the odd behaviour. I'm running the latest DJGPP, on a Win95 DosBox. In info page of setmode() there's no hint about where O_BINARY is defined. It is in fcntl.h not in io.h where setmode() is declared, shouldn't be adviced the poor programmer ? ;) I've the K&R at a couple of meters from here, should I move it closer ? ------------------------ #include #include #include #define SIZE 100 /* my try */ { FILE *f; int FileHandle = 0; char Buf[10]; setmode(FileHandle, O_BINARY); f = fdopen(FileHandle, "rb"); setvbuf(f, NULL, _IOFBF, SIZE); if (fread(Buf, 1, 9, f) != 9) { /* do something */ } fclose(f); } --------------------- TIA Stefano