Single Status Update
In C/C++ class we have an assignment due (actually due two weeks ago, but I have an extension) where we have to make a very simple client/server program. The client sends data to a server, which writes a very simple database of whatever we want. So I'm making a simple videogame database.
The thing is, we have to use system calls for the files, so open(), close(), read(), and write(). I've got everything working, reading, and writing fine except one thing. The database I made is über simple: first four bytes are an integer saying how many records are in it, the rest are records (structs). When I write a new one, the program's suppose to just overwrite the first four bytes, goto the end, and write there. For some reason, even though write() returns that it wrote four bytes, it still never gets past 1. Code:
Am I doing something wrong?