devfs package

import "code.pfad.fr/devf/devfs"

package devfs exposes FS utilities (watch a directory for changes, fallback chain of FS).

Index

func WatchedDir

WatchedDir returns a wrapped os.DirFS. Each opened file is added to a watchlist, any write to those file (by external processes) is notified on the provided messages channel.

At most maxWatchedDirs will be watched (folder opened the least recently will be evicted if needed).

type FallbackFS

FallbackFS will try to Open a file from each of the underlying fs, until succesful.

func (FallbackFS) Open

Source Files

fallbackfs.go watcher.go