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

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

@rcholic

Description

@rcholic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions