directory_monitor 1.0.1 copy "directory_monitor: ^1.0.1" to clipboard
directory_monitor: ^1.0.1 copied to clipboard

Directory Monitor is a directory monitoring tool that can monitor file and directory changes in a directory and execute corresponding callback functions..

Directory Monitor #

Pub

Directory Monitor is a directory monitoring tool that can monitor file and directory changes in a directory and execute corresponding callback functions.

Dart uses ffi to implement dmon extension

Use it #

import 'package:directory_monitor/directory_monitor.dart';

void main() async {
  try {
    final watcher = await DirectoryMonitor.create(
      watchDir: 'watcher_dir/',
      recursive: true,
      debugMode: true,
      ignoredPaths: [
        // "*.tmp",
        // "*.swp",
        // "*.bak",
        // "*.bk",
        // ".DS_Store",
        // ".Trashes",
        // ".Spotlight-V100",
        // ".fseventsd",
      ],
      allowedExtensions: [
        // '.txt',
        // '.mp3',
        // '.flac',
        // '.m4a',
        // '.ogg',
        // '.wav',
        // '.ape',
        // '.mp4',
        // '.mov',
        // '.opus',
      ],
    );
    watcher.listen((event) {
      print(event);
    });
    //watcher.stop();
  } catch (e) {
    print('error: $e');
  }
}
1
likes
160
points
38
downloads

Documentation

API reference

Publisher

verified publishermusichub.cc

Weekly Downloads

Directory Monitor is a directory monitoring tool that can monitor file and directory changes in a directory and execute corresponding callback functions..

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

ffi, package_config, path

More

Packages that depend on directory_monitor