Skip to content

OS_rename() doesn't first check if a file is in use #116

@skliper

Description

@skliper

The osfileapi.c OS_rename() doesn't check if a file is in use or not (in an entry in the global OS_FDTable) before it makes the system call to rename the file.

However, this is in contrast to OS_cp(), OS_mv(), or OS_remove() - which do check if the file is open (according to the OS_FDTable entry). If those functions see that the file is open then they return and don't alter the filesystem. So this behavior seems quite different for functions at affect a file.

The documentation of the OSAL API doesn't explicitly mention any behavior tied to a file that is in use by the OSAL for any of these functions (although the implementation is very clear for those other three functions.)

Discovered in #106, as part of #45 unit testing.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions