Class PackageFileNames
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
File names of VPK packages: a package split into chunks is a name_dir.vpk directory file with numbered name_000.vpk archive chunks next to it, and a game folder mounts its numbered pakNN_dir.vpk packages.
public static class PackageFileNamesInheritance
object ← PackageFileNames
Methods
EnumeratePakDirectoryFiles(string)
Finds the pakNN_dir.vpk files a game mounts from a folder, in numeric order. Numbers may have gaps, and pak00_dir.vpk is never mounted.
public static IEnumerable<string> EnumeratePakDirectoryFiles(string folder)Parameters
folder string
Returns
IEnumerable<string>
FindAddonPackage(string, string)
Finds an addon packed as folder/name.vpk, or split into chunks with folder/name_dir.vpk.
public static string? FindAddonPackage(string folder, string name)Parameters
folder string
name string
Returns
string?
The path of the package, or null when there is none.
GetArchiveChunkFile(string, int)
Gets the file name of an archive chunk of a split package, such as pak01_003.vpk.
public static string GetArchiveChunkFile(string packageName, int archiveIndex)Parameters
packageName string
The package name, see PackageFileNames.GetPackageName(string).
archiveIndex int
The index of the chunk.
Returns
string
GetDirectoryFile(string)
Gets the _dir.vpk directory file of a package, such as pak01_dir.vpk for pak01_003.vpk or pak01.vpk.
public static string GetDirectoryFile(string path)Parameters
path string
Returns
string
GetPackageName(string)
Gets the name of a package without the .vpk extension and the _dir or archive chunk suffix, such as pak01 for pak01_dir.vpk and pak01_003.vpk. A package read from a _dir.vpk file has this as its file name.
public static string GetPackageName(string path)Parameters
path string
Returns
string
GetPakNumber(string)
Gets the number of a pakNN_dir.vpk file name, or -1 for any other name.
public static int GetPakNumber(string fileName)Parameters
fileName string
Returns
int
IsArchiveChunk(ReadOnlySpan<char>)
Whether a path names an archive chunk of a split package, such as pak01_003.vpk.
public static bool IsArchiveChunk(ReadOnlySpan<char> path)Parameters
path ReadOnlySpan<char>
Returns
bool

