aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-13 23:12:56 +0200
committerJakob Unterwurzacher2015-09-13 23:12:56 +0200
commiteee2c017dc39d2e0df025dc73cbad0f5b7f8e358 (patch)
treef6438654782ce33adc74e040dddf8dcebea5b0cd /main.go
parentd941b67df4f20393712a2d2e8df2b657b663d226 (diff)
init: Check if dir is empty part I
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.go b/main.go
index 70928cf..6aed734 100644
--- a/main.go
+++ b/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 {