next_block function

Read the next block of data from a file.