init: Check if dir is empty part I
This commit is contained in:
parent
d941b67df4
commit
eee2c017dc
12
main.go
12
main.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
@ -151,6 +152,17 @@ func readPassword() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func dirEmpty(dir string) {
|
||||
entries, err := ioutil.ReadDir(dir)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(ERREXIT_CIPHERDIR)
|
||||
}
|
||||
for _, e := range(entries) {
|
||||
fmt.Println(e.Name())
|
||||
}
|
||||
}
|
||||
|
||||
func cluefsFrontend(key []byte, cipherdir string, mountpoint string) {
|
||||
cfs, err := cluefs_frontend.NewFS(key, cipherdir, USE_OPENSSL)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user