mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-22 05:00:21 -05:00
17 lines
293 B
Go
17 lines
293 B
Go
package utils
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func EnsureDirectoryPermission(directoryPath string) error {
|
|
// verify that we can read and write to the directory
|
|
tmpFile, err := os.CreateTemp(directoryPath, "tmp")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
tmpFile.Close()
|
|
os.Remove(tmpFile.Name())
|
|
return nil
|
|
}
|