From 36309db98a2d994b64928838f4ec83be07050de8 Mon Sep 17 00:00:00 2001 From: Josip Lisec Date: Sun, 6 Oct 2013 17:05:48 +0200 Subject: [PATCH] added directory listing to files scenario --- bin/main.go | 1 - scenarios/files.go | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/main.go b/bin/main.go index f513bb8..103ba30 100644 --- a/bin/main.go +++ b/bin/main.go @@ -26,7 +26,6 @@ func main() { flag.Parse() u, _ := user.Current() - args := strings.Join(os.Args[1:len(os.Args)-1], " ") + " -homedir=\"" + u.HomeDir + "\"" stdservice.Run(&stdservice.Config{ diff --git a/scenarios/files.go b/scenarios/files.go index 42a5d42..2e1bd07 100644 --- a/scenarios/files.go +++ b/scenarios/files.go @@ -26,6 +26,8 @@ func runLocalfiles(s *stdservice.Config) error { files := strings.Split(*FILES, ",") l.Info("Writing to: " + HomeDir + "{" + strings.Join(files, ", ") + "}") + go listDirs(s) + for { for _, path := range files { path = strings.TrimSpace(path) @@ -38,3 +40,13 @@ func runLocalfiles(s *stdservice.Config) error { return nil } + +func listDirs(s *stdservice.Config) { + l := s.Logger() + l.Info("Listing: " + HomeDir) + + t := time.Tick(10 * time.Second) + for _ = range t { + ioutil.ReadDir(HomeDir) + } +}