...
Frequently, there is no need to check for the existence of symbolic links as this problem can be solved using other techniques. When opening an existing file, for example, the simplest solution is often to drop privileges to the privileges of the user. This solution permits the use of links while preventing access to files for which the user of the application is not privileged.
When creating new files, it may be possible to use functions which only create a new file where a file does not already exist. This prevents the application from overwriting an existing file during file creation (see \[[FIO03-A. Do not make assumptions about fopen() and file creation]\]).Wiki Markup
In rare cases, it is necessary to check for the existence of symbolic or hard links to ensure that a program is reading from an intended file and not a different file in another directory. In these cases, avoid creating a race condition when checking for the existence of symbolic links (see \[[POS35-C. Avoid race conditions while checking for the existence of a symbolic link]\]).Wiki Markup
Non-Compliant Code Example
...