X-Git-Url: http://www.git.stargrave.org/?p=glocate.git;a=blobdiff_plain;f=main.go;h=c18be4409d252ffa15b06e852f3a9f8b23fcf6339038057ae82c20a429f934bd;hp=affdffc8d95d0c7179d7cc9359c524cb8f963669053a888a9da1f6d8b3e237e5;hb=e796780ae74b49e3a44ec2c20dfb3b22fa3c7916aa96d2e27937f5658eea2b6b;hpb=ecb9a41c73d8d7d8c75215c57d5d91f6c476098d756489036bedb8f136e8fb9e diff --git a/main.go b/main.go index affdffc..c18be44 100644 --- a/main.go +++ b/main.go @@ -5,10 +5,13 @@ import ( "log" "os" "path" + "path/filepath" "strings" "syscall" ) +var TmpDir string + type Ent struct { name []string mtime int64 @@ -41,6 +44,13 @@ func main() { flag.Parse() log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds | log.Lshortfile) + var err error + TmpDir, err = filepath.Abs(*dbPath) + if err != nil { + panic(err) + } + TmpDir = path.Dir(TmpDir) + if *doIndex { tmp := index() tmp.Close()