[cs631apue] How to prevent "creat" open already opened file

Shenghan Gao sgao9 at stevens.edu
Wed Sep 16 19:44:17 EDT 2015

Hi everyone,

Currently, I'm implementing tcp. If I use tcp like this:

./tcp  ./filename filename

The file would be set to 0 bytes. Is there a way that I could prevent copy
target are actually the same file with the copy source.

I know I could compare names of two paths. But simply compare the name
couldn't prevent this if there is a symbolic link.

Shenghan Gao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20150916/f3ab4326/attachment.html>

More information about the cs631apue mailing list