In order to support archive formats like ZIP and tar for session logs, there has to be support for multiple files inside an archive. This means they should be treated like a folder, so the first step is to add folder support for session_logs(). This can later be built upon to check for archives in the absence of such folders, in the same way that gzipped files are now accessed in the absence of text files.
If we allow any arbitrary folders or archives in the sessions directory, that could cause major performance hits when a file really doesn’t exist. We can’t have KoLmafia decompressing a decade of session logs because someone didn’t play yesterday. That means there should be a limited number of places to search for a specific file. I’d also caution against actually creating and writing to folders, since that would be a breaking change.
Here is how I think this should work, using the log file Saklad5_20180810.txt as an example:
The user would have to create these folders and move things to them.
If we allow any arbitrary folders or archives in the sessions directory, that could cause major performance hits when a file really doesn’t exist. We can’t have KoLmafia decompressing a decade of session logs because someone didn’t play yesterday. That means there should be a limited number of places to search for a specific file. I’d also caution against actually creating and writing to folders, since that would be a breaking change.
Here is how I think this should work, using the log file Saklad5_20180810.txt as an example:
- Try sessions/Saklad5_20180810.txt
- Try sessions/Saklad5_20180810.txt.gz
- Try sessions/2018/Saklad5_20180810.txt
- Try sessions/2018/Saklad5_20180810.txt.gz
- Try sessions/2018/08/Saklad5_20180810.txt
- Try sessions/2018/08/Saklad5_20180810.txt.gz
The user would have to create these folders and move things to them.
Last edited: