Skip to content

lzurbriggen/dirwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIP

Odin library to watch for changes in a directory.

Note

Primarily for personal use. I will look at issues/PRs at my leisure, or not at all.

Platforms

  • Linux (inotify)
  • Windows (ReadDirectoryChangesExW)

Usage

import "dirwatch"

watch, err := dirwatch.create(10)
defer dirwatch.destroy(&watch)

dirwatch.watch_dir(&watch, "./my-dir", recursive = true)

for {
	if data, ok := chan.try_recv(watch.chan); ok {
		log.info("Event received:", data)
    // e.g. Msg{target = "File", event = Ev_Modified{path = "test.txt"}}
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages