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

Tyler Romeo tromeo at stevens.edu
Thu Sep 17 02:30:19 EDT 2015

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.

Tyler Romeo
Stevens Institute of Technology
Class of 2016

On Wed, Sep 16, 2015 at 9:48 PM, Jan Schaumann <jschauma at stevens.edu> wrote:

> Shenghan Gao <sgao9 at stevens.edu> wrote:
> > I know I could compare names of two paths. But simply compare the name
> > couldn't prevent this if there is a symbolic link.
> Correct.  You would need to find another way of testing whether or not
> two given filenames reference the exact same file.  Take a look at
> stat(2).
> -Jan
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs631apue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20150917/2c4abfbb/attachment.html>

More information about the cs631apue mailing list