CS631 -- Advanced Programming in the UNIX Environment - HW#1
File Descriptors Warmup Exercise
Write 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?