mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
59939cf320
Unlike the old installer in config/module, this uses new-style installation directories that include the static module path so that paths we show in diagnostics will be more meaningful to the user. As before, we retrieve the entire "package" associated with the given source string, rather than any given subdirectory directly, because the retrieved module may contain ../ references into parent directories which must be resolvable after extraction.
22 lines
367 B
Go
22 lines
367 B
Go
// +build freebsd
|
|
|
|
package configload
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
// lookup the inode of a file on posix systems
|
|
func inode(path string) (uint64, error) {
|
|
stat, err := os.Stat(path)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
if st, ok := stat.Sys().(*syscall.Stat_t); ok {
|
|
return uint64(st.Ino), nil
|
|
}
|
|
return 0, fmt.Errorf("could not determine file inode")
|
|
}
|