I\'m trying to read binary data in a C program with read() but EOF test doesn\'t work. Instead it keeps running forever reading the last bit of the file.
read returns the number of characters it read. When it reaches the end of the file, it won't be able to read any more (at all) and it'll return 0, not EOF.