#include <oskit/fs/dir.h>oskit_error_t oskit_dir_rename(oskit_dir_t *old_dir, const char *old_name, oskit_dir_t *new_dir, const char *new_name);
client OS filesystem library
This method atomically links the file named by old_name in old_dir into new_dir, using new_name for the new directory entry, and unlinks old_name from old_dir.If a file named new_name already exists in new_dir, then it is first removed. In this case, the source and target files must either both be directories or both be non-directories, and if the target file is a directory, it must be empty.
Typically, this is only supported if new_dir resides in the same filesystem as old_dir.
The old_name and new_name may each only be a single component; multi-component lookups are not supported.
- old_dir
- This directory.
- old_name
- The name of the file to be renamed.
- new_dir
- The target directory.
- new_name
- The name for the new directory entry.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.