I am working on recover, currently pset, and only my last photo is not processing properly.
I am calling fread(buffer, 1, 512, inptr) to read 512 bytes of data at a time. The video says fread returns the amount of data read, but I seem to only be getting 512 or 0 (for the last block). I suspect that the last block has something less than 512 bytes, and I was under the impression that fread() should return how many bytes were grabbed. I can't really tell if I am getting the last partial block twice or if it just returns nothing since it hits the end of the file.
IF there were 200 bytes in the last block of the file pointed to by inptr and I call fread(buffer, 1, 512, inptr), will fread return 200 and read 200 bytes of data? Or does it behave differently when it sees EoF?
Thanks for any help