HFSNotify 项目教程

随笔1天前发布 陈洋
4 0 0

HFSNotify 项目教程

hfsnotifyUnified Haskell interface for basic file system notifications项目地址:https://gitcode.com/gh_mirrors/hf/hfsnotify

1. 项目的目录结构及介绍

HFSNotify 是一个用于 Haskell 的文件系统监控库。以下是项目的目录结构及其介绍:




hfsnotify/


├── CHANGELOG.md


├── LICENSE


├── README.md


├── Setup.hs


├── hfsnotify.cabal


├── src/


│   ├── System/


│   │   └── FSNotify/


│   │       ├── Manager.hs


│   │       ├── Types.hs


│   │       └── ...


│   └── ...


├── test/


│   ├── Spec.hs


│   └── ...


└── ...

CHANGELOG.md: 记录项目的变更历史。LICENSE: 项目的许可证文件。README.md: 项目的基本介绍和使用说明。Setup.hs: Haskell 项目的构建脚本。hfsnotify.cabal: Cabal 构建文件,包含项目的依赖和构建信息。src/: 源代码目录,包含项目的核心代码。
System/FSNotify/: 文件系统监控的核心模块。
Manager.hs: 管理文件系统监控的模块。Types.hs: 定义文件系统监控相关的数据类型。 test/: 测试代码目录,包含项目的测试用例。
Spec.hs: 测试规范文件。

2. 项目的启动文件介绍

HFSNotify 项目的启动文件是 src/System/FSNotify/Manager.hs。这个文件包含了管理文件系统监控的主要逻辑和接口。




module System.FSNotify.Manager (


    -- * Manager


    WatchManager,


    startManager,


    stopManager,


    withManager,


    withManagerConf,


    -- * Watching


    watchDir,


    watchTree,


    unwatch,


    -- * Events


    Event(..),


    EventChannel,


    EventPredicate,


    eventPath,


    eventTime,


    eventIsDirectory,


    eventType,


    -- * Errors


    FSNotifyException(..),


    -- * Configuration


    WatchConfig(..),


    defaultConfig


) where


 


import System.FSNotify.Types


import System.FSNotify.Watch


import System.FSNotify.Manager.Internal


import Control.Concurrent.STM


import Control.Exception


import Control.Monad


import Data.Time.Clock


import System.FilePath


import System.IO.Error


import System.Posix.Files


import System.Posix.Types


import System.Directory


import System.FSNotify.Platform

3. 项目的配置文件介绍

HFSNotify 项目的配置文件是 hfsnotify.cabal。这个文件包含了项目的依赖、构建选项和其他配置信息。




name:                hfsnotify


version:             0.1.0.0


synopsis:            Cross-platform filesystem notification for Haskell


description:         Please see the README on GitHub at <https://github.com/haskell-fswatch/hfsnotify#readme>


homepage:            https://github.com/haskell-fswatch/hfsnotify


license:             BSD3


license-file:        LICENSE


author:              Niklas Hambüchen <mail@nh2.me>


maintainer:          Niklas Hambüchen <mail@nh2.me>


copyright:           Niklas Hambüchen


category:            System


build-type:          Simple


extra-source-files:  CHANGELOG.md


cabal-version:       >=1.10


 


library


  exposed-modules:     System.FSNotify


                     , System.FSNotify.Manager


                     , System.FSNotify.Types


                     , System.FSNotify.Watch


  other-modules:       System.FSNotify.Manager.Internal


                     , System.FSNotify.Platform


  build-depends:       base >=4.12 && <4.13


                     , bytestring


                     , containers


                     , directory


                     , filepath


                     , process


                     , stm


                     , time


                     , unix


  default-language:    Haskell2010


 


test-suite hfsnotify-test


  type:                exitcode-stdio-1.0


  main-is:             Spec.hs


  other-modules:       System.FSNotify.Test


  build-depends:       base


                     , hfsnotify


                     , hspec

hfsnotifyUnified Haskell interface for basic file system notifications项目地址:https://gitcode.com/gh_mirrors/hf/hfsnotify

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...