Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content count

  • Joined

  • Last visited

About YukiRaven

  • Rank
    Will DDR for food

Recent Profile Visitors

15089 profile views

Single Status Update

See all updates by YukiRaven

  1. 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:

    code snippit

    Am I doing something wrong?

    1. YukiRaven


      Actually, I found out it was because I was opening it with the flag O_APPEND or'ed in.

    2. AndrewB


      Ohhh.. Of course!