HW7
COP-3402
- How can we determine whether two paths refer to the same file?
- What flag to open will create a file if it doesn't exist already? (See lecture notes and/or
man 2 open
) - What happens if we try to open a file that does not exist?
- What flag truncates a file upon opening?
- What happens if we open a file that already existing for writing, without truncating it, and then write bytes to it?
- Write a syscall that opens a file called "hello" for writing, creating it if it doesn't exist, but truncating if it doesn't. Remember to include error checking that exits with EXIT_FAILURE if the open fails.