StormLib API Reference

SFileRenameFile

Description

bool WINAPI SFileRenameFile(
  HANDLE hMpq,                      // Handle to the MPQ
  const char * szOldFileName,       // The name of a file to be renamed
  const char * szNewFileName        // New name of the file
);

Function SFileRenameFile renames a file within MPQ. The MPQ must have been open by SFileOpenArchive or created by SFileCreateArchive. Note that this operation does not cause MPQ fragmentation and thus it is not necessary to compact the archive.

Parameters

hMpq
[in] Handle to an open MPQ. This handle must have been obtained by calling SFileOpenArchive or SFileCreateArchive.
szOldFileName
[in] Name of a file to be renamed.
szNewFileName
[in] New name of the file.

Return Value

When the function succeeds, it returns nonzero. On an error, the function returns false and GetLastError gives the error code.

Remarks

The function only renames file with the specified locale. Unlike SFileOpenFileEx, if the file with preset locale doesn't exist in the MPQ, the function fails. For more informations about preset locale, see SFileSetLocale.

Availability in Storm.dll

Available in Storm.dll No
Ordinal number in Storm.dll 1.00 N/A
Ordinal number in Storm.dll 1.09 N/A