Maybe someone is searching for this
As of this writing I noticed that RemoveDir native does not support valve file system
PHP Code:
/**
* Deletes a directory/folder recursively.
*
* @param path Path to directory/folder.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to find files existing in any of
* the Valve search paths, rather than solely files
* existing directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return True on success and false otherwise.
* @error Directory is not exists or unaccessable.
*/
stock bool:DeleteDirectory(const String:path[], bool:use_valve_fs=false, const String:valve_path_id[]="GAME")
{
decl String:dirEntry[PLATFORM_MAX_PATH];
new Handle:__dir = OpenDirectory(path, use_valve_fs, valve_path_id);
if (__dir != INVALID_HANDLE)
{
new FileType:file_type = FileType_Unknown;
while (ReadDirEntry(__dir, dirEntry, sizeof(dirEntry), file_type))
{
if (StrEqual(dirEntry, ".") || StrEqual(dirEntry, ".."))
{
continue;
}
switch (file_type)
{
case FileType_File :
{
Format(dirEntry, sizeof(dirEntry), "%s/%s", path, dirEntry);
DeleteFile(dirEntry, use_valve_fs, valve_path_id);
}
case FileType_Directory :
{
Format(dirEntry, sizeof(dirEntry), "%s/%s", path, dirEntry);
DeleteDirectory(dirEntry, use_valve_fs, valve_path_id);
}
}
}
CloseHandle(__dir);
return RemoveDir(path);
}
LogError("Directory %s does not exist or is inaccessible!", path);
return false;
}