The fs-watcher Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The fs-watcher Reference Manual

This is the fs-watcher Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Nov 15 05:46:11 2022 GMT+0.

Table of Contents


1 Introduction

fs-watcher

Description

Watches for filesystem changes to act upon them.

Documentation

There is not much to this library. Only a single function.

Installation

(ql:quickload 'fs-watcher)

The watch function

This is the signature of the function:

(fs-watcher:watch pathnames callback &key (delay 1))

At first, the function will get the list of all pathnames. For example, if you give a directory pathname, fs-watcher will recursively look for files and directories in it.

Once it has all the necessary information, it constantly polls for them to see if there is any change. This polling is done every second by default.

Whenever there is a change, the callback is called with an argument: the pathname that changed.

Usage example

(fs-watcher:watch "/home/user/code/" #'(lambda (pathname)
                                         (inferior-shell:run/s "make")))

Contributors

License

MIT License.


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 fs-watcher

Filesystem watcher for changes

Author

Florian Margaine <florian@margaine.com>

License

MIT License

Dependencies
  • com.gigamonkeys.pathnames (system).
  • alexandria (system).
Source

fs-watcher.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 fs-watcher/fs-watcher.asd

Source

fs-watcher.asd.

Parent Component

fs-watcher (system).

ASDF Systems

fs-watcher.


3.1.2 fs-watcher/src/package.lisp

Source

fs-watcher.asd.

Parent Component

fs-watcher (system).

Packages

fs-watcher.


3.1.3 fs-watcher/src/fs-watcher.lisp

Dependency

src/package.lisp (file).

Source

fs-watcher.asd.

Parent Component

fs-watcher (system).

Public Interface

watch (function).

Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 fs-watcher

Source

src/package.lisp.

Use List
  • com.gigamonkeys.pathnames.
  • common-lisp.
Public Interface

watch (function).

Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Ordinary functions

Function: watch (pathnames callback &key delay)

Watches a list of pathnames

Package

fs-watcher.

Source

src/fs-watcher.lisp.


5.2 Internals


Previous: , Up: Internals   [Contents][Index]

5.2.1 Ordinary functions

Function: dir-contents (pathnames)

For each directory, collect the file pathnames recursively. Results are appended and returned as a single list.

Package

fs-watcher.

Source

src/fs-watcher.lisp.

Function: mtime (pathname)

Returns the mtime of a pathname

Package

fs-watcher.

Source

src/fs-watcher.lisp.

Function: run-loop (pathnames mtimes callback delay)

The main loop constantly polling the filesystem

Package

fs-watcher.

Source

src/fs-watcher.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables