Apue chapter 5 exercises change in fileIO

As the title.