Home > Net >  What is equivalent of "$HOME/.cache" on Windows?
What is equivalent of "$HOME/.cache" on Windows?

Time:11-24

I want to store some intermediate results in cache on file system.

On Linux I can use simple

cache_dir = getenv("HOME")   "/.cache/my_program_dir"

What would be similar location on Windows and how to access (which environment variables etc)

CodePudding user response:

$HOME would be "USERPROFILE". You may create your cache there, just like you do in Linux (inside .cache, that is).

However, there can be an alternative location, accessed via "LOCALAPPDATA". If you put a folder for "my_program" there, you can organize it like you please. Be sure, however, that the actual name of "my_program" is sufficiently unique.

  • Related