<div dir="ltr">Make sure to read the whole man page, as it also contains the very similar fstat(2), which is equivalent except operates on file descriptors instead of paths.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-- <br>Tyler Romeo<br>Stevens Institute of Technology<br>Class of 2016</div></div></div>
<br><div class="gmail_quote">On Wed, Sep 16, 2015 at 9:48 PM, Jan Schaumann <span dir="ltr">&lt;<a href="mailto:jschauma@stevens.edu" target="_blank">jschauma@stevens.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Shenghan Gao &lt;<a href="mailto:sgao9@stevens.edu">sgao9@stevens.edu</a>&gt; wrote:<br>
<br>
&gt; I know I could compare names of two paths. But simply compare the name<br>
&gt; couldn&#39;t prevent this if there is a symbolic link.<br>
<br>
</span>Correct.  You would need to find another way of testing whether or not<br>
two given filenames reference the exact same file.  Take a look at<br>
stat(2).<br>
<br>
-Jan<br>
_______________________________________________<br>
cs631apue mailing list<br>
<a href="mailto:cs631apue@lists.stevens.edu">cs631apue@lists.stevens.edu</a><br>
<a href="https://lists.stevens.edu/mailman/listinfo/cs631apue" rel="noreferrer" target="_blank">https://lists.stevens.edu/mailman/listinfo/cs631apue</a><br>
</blockquote></div><br></div>