Question

This is for a Unix class: Explain the difference between soft link and hard link and...

This is for a Unix class:

  1. Explain the difference between soft link and hard link and come out with your own step-by-step example demonstrating the differences between two link types.

2. What’s the final effect of the following statements? (hint: Explain them in terms of the stdio and kernel buffers.)

fflush(aFilePointer);

fsync(fileno(aFilePointer));

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Difference between softlink and hardlinks:

  • Hardlink means an additional name is given to the existing file whereas a softlink is something like a shortcut, it will point to the original file.
  • The inode number of a hardlink will be same as that of the original file, whereas inode number of software is different.
  • Hardlink will be there if we delete the original file, whereas in softlink, the pointer will move to a dangling position, when the original file is deleted.

Hardlink command:

ln source_file dest_file

Softlink commmand

ln -s source_file dest_file

2. fflush usually works on file level, and it will flush the internal buffer of the file. Whereas fsync works at a lower level as compared to fflush, because it will instruct the OS to flush the nuffer to physical media. Usually fsync work as file descriptor.

Add a comment
Know the answer?
Add Answer to:
This is for a Unix class: Explain the difference between soft link and hard link and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT