Legacy Reference


This tutorial demonstrates two different methods of loading a file: from inside a .pak archive, and directly from the file system. Before you can start, you need a file in a .pak archive, and a file with the same name (but with different content) in the file system. To verify which file is loaded, the example makes use of the content inside each text file.

To prepare sample files

  1. Create a text file named ExampleText.txt.

  2. Using a text editor, open ExampleText.txt and type in the following text:

  3. This sample was read from the .pak archive
  4. Save the file.

  5. Inside the GameSDK directory, create a subfolder called Examples.

  6. Add the ExampleText.txt file to the Examples folder so that the path looks like this:


  7. Run the following command from the directory root\GameSDK:

    ..\Tools\7za.exe a -tzip -r -mx0 Examples.pak Examples

    This command uses the executable file 7za.exe (located in the Tools folder) to create an archive of the Examples folder called Examples.pak. Because you ran the command from the GameSDK folder, the archive was saved to the GameSDK folder. The .pak file contains only the file Examples\ExampleText.txt.

  8. Using a text editor, change the text inside the <root>\GameSDK\Examples\ExampleText.txt file to something different, for example:

    This sample was read from the file system

Now you have two different text files with the same destination path, except that one is stored directly in the file system, and the other is inside the .pak file.