Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If the programmer's intent is not to remove an existing destination file, the POSIX access() function can be used to check for the existence of a file [Open Group 2004IEEE Std 1003.1:2013]. This compliant solution renames the source file only if the destination file does not exist:

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

FIO10-C

mediumMedium

probableProbable

mediumMedium

P8

L2

Automated Detection

Tool

Version

Checker

Description

PRQA QA-C
Include Page
PRQA_V
PRQA_V
Warncall warncall -wc renamePartially implemented

...

Bibliography

MSDN]
[IEEE Std 1003.1:2013]XSH, System Interfaces, access
[MSDN]renamerename()[Open Group 2004]access()

 

...