Unmounting PAK does not close file
My game mounts pak files at runtime containing custom maps. Occasionally, these pak files may need to be re-downloaded while they are mounted. The issue I'm running into is that my steam workshop download fails to complete because the pak file is locked. I've tried simply unmounting the pak before download, but that does not seem to unlock the file; the download still fails and i cannot modify the file in file explorer until I close my game.
I've managed to work around this by copying pak files to a
My guess is that IPlatformFilePak is leaving a FileHandle open on mount and there's no way to close it. So far I've found this one:
I do not see PakHandle being closed, but I tried doing something like
asked Aug 04 '17 at 05:28 AM in Bug Reports
Actually I am able to delete unmounted paks from my PakCache which indicates to me that this was a user error. There is an issue however with proper pak unmounting when paks are mounted the way most resources say to do it. This is the recommended solution for mounting pak files at runtime:
This works, however, when you go to unmount the pak it will not be registered because there's a new PakPlatform every time. It will be removed from the pak precacher but the file handle will never be deleted. In order for this to happen, I had to initialize the PakPlatform file in my GameInstance's Init function and keep a pointer to it in the game instance. Then I just use that pointer to mount/unmount everything.
Follow this question
Once you sign in you will be able to subscribe for any updates here