Thanks for the reply, I will try to clarify some points:
have 3 files.
First one a header with the struct and function definition:
Second one with the main()
int review(int fd);
In this one I'm trying to measure the time before and after the function, but is not working very good.
struct timeval t1, t2;
fd=open("datos.bin", O_RDWR, S_IRWXO);
printf("File Descriptor: %d\n", fd);
printf("time 1: %.6f \n",secs);
printf("time 2: %.6f \n",secs);
I also open the file
Third one with the function
The problem is that nbytes is different each time I run the program.
int review(int fd)
I want to read each structure in the file and then manipulate it, but I'm not sure how I can pass the struct to the function review() and how to use lseek to find a value of evaluation->notamedia < 3.
The main point is how can I manage the .bin file, I cannot even edit it to see how the data is structured there. So I cannot figure out how to use a function to find a specific data inside.
Maybe a pointer that which contais a 3.5 or bigger in binary format? lseek() function?
Thanks a lot for your help