Skip to content

Avoid the global temp directory for most operations (especially BAIN) #665

@Infernio

Description

@Infernio

Overview

Using the global directory is mostly fine on Windows (where it'll reside on a physical disk), but on Linux it usually sits in RAM. And if you happen to fill it up, the entire machine can deadlock.

Instead it'd be better to create an option for this (falling back to the global directory during early boot, before settings are loaded), defaulting to e.g. Bash Mod Data/Temp. This way a user can easily adjust it via settings.

Pros:

  • Avoids a potential deadlock on Linux (this isn't just hypothetical - extracting a mod that's 8GB+ unpacked would deadlock my system)
  • On Windows, a lot of people put their games outside C: (where %Temp% normally is), e.g. to G:. This means a BAIN installation proceeds as follows: extract to C: -> move to G:. Since these are separate devices, the data has to be physically copied from one to the other. If we have our temp dir on G: however, the move is on a single device - this is nearly instant on most filesystems and should make BAIN installations much faster.

Cons:

  • There's the potential that we might run out of space here if the installation would have overwritten some files in the game folder. But that problem already existed - we could also run out of space in the temp folder. A user who is running this low on space should really clean up or adjust the option to choose a less full drive for the temp folder.

Open Resolved Questions

  • Where do we put the default?
    • Ideally on the same device as the game, otherwise we lose the second pro.
      • Yup
    • On Windows something like G:\.wbtemp for G:\steam\steamapps\common\Skyrim is easy to figure out, but what about Linux?
      • On Linux (and macOS?), move up to find the last parent of the Data folder that has the same device ID and user ID, i.e. is on the same filesystem/device and owned by the same user.
    • We should probably also mark the folder clearly - a generated README in there?
      • Yup
    • Should we hide it? Our current temp folder is obviously hidden as well, so...
      • Yup

Sub-issue of #243.

Metadata

Metadata

Assignees

Labels

A-bainArea: BAIN (BAsh INstallers, in bosh/bain.py)A-linuxArea: Linux SupportC-enhancementCategory: Enhancement, a request to add or enhance a featureM-relnotesMisc: Issue should be listed in the version history for its milestone

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions