HFSNotify 项目教程

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

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

羿漪沁Halbert

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值