GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - weshipsoftware/fs-diff-stream: Watch for MacOS file system changes.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.nova
.nova
 
 
.gitignore
.gitignore
 
 
FSDiffStream.swift
FSDiffStream.swift
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 

Repository files navigation

FSDiffStream

Watch for MacOS (v13+) file system changes from your Swift app.

Installation

Add FSDiffStream as a dependency to your Package.swift manifest:

let package = Package(
  ...
  dependencies: [
    .package(url: "https://github.com/jarrodtaylor/fs-diff-stream.git", from: "1.0.0")
  ],
  ...
  targets: [
    .target(name: "...", dependencies: [
      .product(name: "FSDiffStream", package: "fs-diff-stream")
    ]),
  ]
  ...
)

Watching for Changes

Import FSDiffStream and give it a local url to watch:

import FSDiffStream

let url = URL(string: "path/to/watch", relativeTo: URL.currentDirectory())!

FSDiffStream(url) { diff in print(diff) }

// Keep the process running while waiting for file system changes.
RunLoop.current.run()

Each time a file or folder is created, updated, or deleted under path/to/watch an array of changes will stream back to your code.

Changes in the array are tuples containing a url and change status:

[
  (url: ..., status: .created),
  (url: ..., status: .updated),
  (url: ..., status: .deleted)
]

About

Watch for MacOS file system changes.

Topics

macosswift

Resources

Readme
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.