Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

$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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading