CS631 -- Advanced Programming in the UNIX EnvironmentFile Descriptors Warmup ExerciseWrite a small program that:
What happens when you open the same file multiple times with or without closing it again in between? Try opening the same file twice, then writing different data to each file descriptor (via write(2)) - what happens? Open an existing file that contains some data - perform alternate read(2) and write(2)s on that file descriptor. What does that tell you about the position in the file as you perform these operations? How would you go about replacing a specific word in a file? Even for this warmup exercise, remember to ensure that your code complies with our requirements (style, checklist, general guidelines). [Course Website] |