[metadata]
id = "FIO10-C"
type = "recommendation"
category = "FIO"
number = 10
title = "Take care when using the rename() function"
description = """
Therename()function has the following prototype: int rename(const char
*src_file, const char *dest_file); If the file referenced bydest_fileexists
prior to callingrename(), the behavior isimplementation-defined. On POSIX
systems, the destination file is removed. On Windows systems, therename()fails.
Consequently, issues arise when trying to write portable code or when trying to
implement alternative behavior.
"""
severity = "Medium"
likelihood = "Probable"
priority = "P4"
level = "L3"
cert_version = "2016 Edition (Wiki)"
last_modified = "May 20, 2025"
[rules.cert_c.FIO10-C]
enabled = true
[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/FIO10-C.+Take+care+when+using+the+rename%28%29+function"