Bfile RenameEntry

From WikiPrizm
Jump to: navigation, search


Synopsis

Header: fxcg/file.h
Syscall index: 0x1DB3
Function signature: int Bfile_RenameEntry(const unsigned short *oldpath, const unsigned short *newpath)

Renames a file or folder in storage memory. Can also be used to move files and folders across directories, like Unix's mv command.

Parameters

  • oldpath - A 16 bit character array containing the path to the existing item, most likely generated by Bfile_StrToName_ncpy.
  • newpath - A 16 bit character array containing the new path for the item, can be generated by Bfile_StrToName_ncpy too.

Returns

0 on success, or a negative error code on failure.

Comments

Using Bfile functions while user timers are installed can cause SYSTEM ERRORs and other undefined behavior, especially with functions that change data on the file system. Make sure to stop and uninstall all timers before using Bfile functions (and optionally restore them later). See Incompatibility between Bfile Syscalls and Timers for more information.