Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add os.getCacheDir #18126

Merged
merged 3 commits into from
May 31, 2021
Merged

add os.getCacheDir #18126

merged 3 commits into from
May 31, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented May 30, 2021

from reading at various reference materials, this seems like the most commonly accepted setting overall

example use case

links

when defined(windows):
getCacheDir() / app / "cache"
else:
getCacheDir() / app
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that just the 1st overload is Ok, the user can make getCacheDir() / "app" themselves, but is just my opinion...

Copy link
Member Author

@timotheecour timotheecour May 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would not be correct for windows; that's the point of this proc, make it portable (other libraries do this too)

lib/pure/os.nim Outdated Show resolved Hide resolved
lib/pure/os.nim Outdated Show resolved Hide resolved
lib/pure/os.nim Outdated Show resolved Hide resolved
lib/pure/os.nim Outdated Show resolved Hide resolved
lib/pure/os.nim Outdated Show resolved Hide resolved
@timotheecour
Copy link
Member Author

PTAL

@Araq Araq merged commit 9559350 into nim-lang:devel May 31, 2021
@timotheecour timotheecour deleted the pr_getCacheDir branch May 31, 2021 20:30
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
* add `os.getCacheDir`

* fixup

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants