DumpPersistentStorage

DumpPersistentStorage

#Overview

name: DumpPersistentStorage

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DumpPersistentStorage is to provide a console command for dumping information about the persistent storage used by the Unreal Engine project. This command is primarily related to the file management system and is used for debugging and inspecting the contents of the persistent download directory.

This setting variable is part of the Core module of Unreal Engine, specifically within the HAL (Hardware Abstraction Layer) subsystem. It’s implemented in the IPlatformFileManagedStorageWrapper.cpp file, which suggests it’s related to the platform-specific file management system.

The value of this variable is set as a static FAutoConsoleCommandWithOutputDevice, which means it’s a console command that can be invoked during runtime. It’s not a traditional setting variable that you would set in a configuration file, but rather a command that can be executed from the console.

There are no other variables directly interacting with DumpPersistentStorage, but it does use several Unreal Engine functions and systems:

  1. FPaths::HasProjectPersistentDownloadDir()
  2. FPaths::ProjectPersistentDownloadDir()
  3. IFileManager::Get().IterateDirectoryStatRecursively()

Developers should be aware of the following when using this command:

  1. It only works if a persistent download directory is configured for the project.
  2. It will recursively iterate through all files and directories in the persistent download directory, which could be time-consuming for large directories.
  3. The output is sent to the provided FOutputDevice, which allows for flexible logging options.

Best practices when using this variable (command) include:

  1. Use it for debugging purposes only, not in production code.
  2. Be cautious when using it on large directories, as it may impact performance.
  3. Ensure that the persistent download directory is properly configured before using this command.

Regarding the associated variable, there isn’t actually a separate associated variable. The code snippet shows the implementation of the DumpPersistentStorage command itself. The command is defined using the FAutoConsoleCommandWithOutputDevice class, which creates a console command that can be invoked to dump information about the persistent storage.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/IPlatformFileManagedStorageWrapper.cpp:19

Scope: file

Source code excerpt:

	}
})
);

static FAutoConsoleCommandWithOutputDevice DumpPersistentStorage(
	TEXT("DumpPersistentStorage"),
	TEXT("Dumps PersistentStorage"),
	FConsoleCommandWithOutputDeviceDelegate::CreateStatic([](FOutputDevice& Output)
		{
			if (!FPaths::HasProjectPersistentDownloadDir())
			{
				Output.Log(TEXT("No persistent download dir configured."));
				return;
			}

			IFileManager::Get().IterateDirectoryStatRecursively(*FPaths::ProjectPersistentDownloadDir(),
				[&Output](const TCHAR* FileOrDir, const FFileStatData& StatData)

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/IPlatformFileManagedStorageWrapper.cpp:18

Scope: file

Source code excerpt:

		UE_LOG(LogPlatformFileManagedStorage, Display, TEXT("%s"), *CategoryStat.Value.Print());
	}
})
);

static FAutoConsoleCommandWithOutputDevice DumpPersistentStorage(
	TEXT("DumpPersistentStorage"),
	TEXT("Dumps PersistentStorage"),
	FConsoleCommandWithOutputDeviceDelegate::CreateStatic([](FOutputDevice& Output)
		{
			if (!FPaths::HasProjectPersistentDownloadDir())
			{
				Output.Log(TEXT("No persistent download dir configured."));
				return;
			}

			IFileManager::Get().IterateDirectoryStatRecursively(*FPaths::ProjectPersistentDownloadDir(),

#Associated Variable and Callsites

This variable is associated with another variable named DumpPersistentStorage. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/IPlatformFileManagedStorageWrapper.cpp:19

Scope: file

Source code excerpt:

	}
})
);

static FAutoConsoleCommandWithOutputDevice DumpPersistentStorage(
	TEXT("DumpPersistentStorage"),
	TEXT("Dumps PersistentStorage"),
	FConsoleCommandWithOutputDeviceDelegate::CreateStatic([](FOutputDevice& Output)
		{
			if (!FPaths::HasProjectPersistentDownloadDir())
			{
				Output.Log(TEXT("No persistent download dir configured."));
				return;
			}

			IFileManager::Get().IterateDirectoryStatRecursively(*FPaths::ProjectPersistentDownloadDir(),
				[&Output](const TCHAR* FileOrDir, const FFileStatData& StatData)

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/IPlatformFileManagedStorageWrapper.cpp:18

Scope: file

Source code excerpt:

		UE_LOG(LogPlatformFileManagedStorage, Display, TEXT("%s"), *CategoryStat.Value.Print());
	}
})
);

static FAutoConsoleCommandWithOutputDevice DumpPersistentStorage(
	TEXT("DumpPersistentStorage"),
	TEXT("Dumps PersistentStorage"),
	FConsoleCommandWithOutputDeviceDelegate::CreateStatic([](FOutputDevice& Output)
		{
			if (!FPaths::HasProjectPersistentDownloadDir())
			{
				Output.Log(TEXT("No persistent download dir configured."));
				return;
			}

			IFileManager::Get().IterateDirectoryStatRecursively(*FPaths::ProjectPersistentDownloadDir(),