Write to and read from a random file