file

package
v0.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(filename string, callback func()) error

Watch watches the given filename and calls the given callback when the file is changed. The watcher uses the parent directory as a watchpoint to be notified if the file doesn't exist when the watcher is created. Example:

	file.Watch("/tmp/test.txt", func() {
		fmt.Println("File created or changed")
	}
)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL