Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

WIP: Add list used files command

Open illwieckz opened this issue 7 years ago • 10 comments

old commit by @slipher initially wrote for kharnov's purpose, was intensively used to clean-up the game packs from dust for 0.51 release. This is also very convenient to check if a file is loaded as expected, like for troubleshooting #159.

Note that some files are loaded dynamically, so be sure to have spawned any character model / weapon and have walked any possible menu to be sure every used file is listed.

I modified the patch a bit to make it working on the now-extracted engine directory, reverted to lowercase override and did some camelCase, whitespace and blank line bikeshedding.

I don't know why this was never merged before, is there any issue with it?

illwieckz avatar Feb 09 '19 18:02 illwieckz

I feel like some combination of "which" and autocomplete somehow already does this.

DolceTriade avatar Feb 10 '19 00:02 DolceTriade

This is not the only interface for opening a pak file, for example there is also FS::PakPath::ReadFile. So it's not exactly correct.

slipher avatar Feb 10 '19 00:02 slipher

To be sure we talk about the same thing: the purpose of this is to only list what's loaded because of it being used, not to list what's available.

illwieckz avatar Feb 10 '19 00:02 illwieckz

can we merge this?

illwieckz avatar Mar 10 '19 20:03 illwieckz

This only handles stuff from the legacy code paths I think?

https://github.com/DaemonEngine/Daemon/blob/3a29a12342f80bd6056e1caa5a002e4d09d42271/src/common/FileSystem.cpp#L710

DolceTriade avatar Mar 10 '19 20:03 DolceTriade

I don't know what you are talking about 🤔

illwieckz avatar Mar 10 '19 21:03 illwieckz

note that we can rename the listFiles command as listLoadedFiles since the purpose of the PR is to provide a way to list files that are loaded because needed (and no more), not to list all files available (that would be another command).

illwieckz avatar Mar 10 '19 21:03 illwieckz

I just renamed from listFiles to listUsedFiles since it basically prints the usedFiles list, and used makes more sense than loaded in this context.

illwieckz avatar Mar 10 '19 21:03 illwieckz

It only counts files that were opened with FS_FOpenFileRead. The engine has other file APIs that don't go through this function, so the results are incomplete (therefore it should not be merged).

slipher avatar Mar 10 '19 23:03 slipher

Ah ok now I understand.

illwieckz avatar Mar 11 '19 00:03 illwieckz