Skip to content

Commit

Permalink
added directory listing to files scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
josip committed Oct 6, 2013
1 parent 5009b82 commit 36309db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion bin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
12 changes: 12 additions & 0 deletions scenarios/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
}

0 comments on commit 36309db

Please sign in to comment.