Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

permission denied in user home directory when open boltdb path #752

Open
rcholic opened this issue Apr 20, 2018 · 1 comment
Open

permission denied in user home directory when open boltdb path #752

rcholic opened this issue Apr 20, 2018 · 1 comment

Comments

@rcholic
Copy link

rcholic commented Apr 20, 2018

I use the following code to create/open a bolt database file under the user home directory on mac:

curUser, err := user.Current()
if err != nil {
  panic(err)
} else {
 dataPath := filepath.Join(curUser.HomeDir, dataPath)
 handle, err := bolt.Open(dataPath, 0644, defaultBoltOptions)
if err != nil {
 log(err) // this tells me permission denied error 
}
}

I wonder why this happened and how to fix it? I run my go code go run main.go as a mac user.

@vincent-petithory
Copy link
Contributor

vincent-petithory commented Apr 20, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants