FSEvents icon indicating copy to clipboard operation
FSEvents copied to clipboard

don't receive the event when i remove a file inside observed folder

Open amine2233 opened this issue 3 years ago • 1 comments

i don't recive an event when i remove a file inside the observed folder, and when i create a file inside the observed folder i have an event but it's 4 seconds after

let paths: [String] = [file.url.absoluteString]
let handler = { event in
    print(event)
}
let s = try EonilFSEventStream(pathsToWatch: paths,
                               sinceWhen: .now,
                               latency: 0,
                               flags: [.fileEvents, .noDefer],
                               handler: handler)
s.setDispatchQueue(DispatchQueue.main)
try s.start()

amine2233 avatar Mar 17 '22 10:03 amine2233

Hello @amine2233 , sorry for late reply. I can't reproduce your issue on my local machine. Can you explain me some more details? Like actual directory file structure? 4 seconds delays sounds like some kind of bottleneck. Do you have massive amount of file operations?

Just to be clear, this library is a thin wrapper around Apple's FSEvents API. That is not designed for precise tracking of all files. The FSEvents service may omit some kind of notifications under certain condition. Please check whether you have one of cases described in this document: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/FSEvents_ProgGuide/TechnologyOverview/TechnologyOverview.html#//apple_ref/doc/uid/TP40005289-CH3-SW1

eonil avatar Jun 11 '22 17:06 eonil