From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id EB22E3858D32 for ; Thu, 6 Oct 2022 16:29:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB22E3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x435.google.com with SMTP id w2so2576676pfb.0 for ; Thu, 06 Oct 2022 09:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=06LOtXZQNL/EqwZtQ4DpZpuq8DHz//oxk0LBAxEzAtA=; b=CVVtEXlTa9gA6KPaUp757DLQaMiFFdqBco1crkXjzZ5JXV0Owq6VU9DSmiBwuTzuF1 2LS6Vj8KM4Ni1pG7gkFIC2aNdAJzi/IoQDNfoTXVcEPX/r3IuPRpzWitLJr61r/0OkCT 5ds3rEEzu4zWlKaS/TSWkUnsXUoUO0VuoWRlwErAx9l1U3SpNqL6uI52aG1BzA1nq3gp f4VBcLpF4TVADSmuPbE/47yGSuHvkwUY1TXCtY7JEO0VL14rwjtIAd4Sso2Wzz3cEmOW 8xPjKW1t+9qqgqa0m6TQFwQX5hE2MucZZtc21fduXMlyNULjvtxgPt6NFk7vJU50uNgH FRKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=06LOtXZQNL/EqwZtQ4DpZpuq8DHz//oxk0LBAxEzAtA=; b=xPtdTTrZyTxsO8pRKt3K8RSP7kcBbUM+TTTKWkX85d6NCeSSt9sBiv+d6lkg6BR3HO 0Kn4clLkgeQRn6BmGKyXRMrX5B1J+clR0OfkdbECJlylHa8eeq15ACqqPFCQLaPli+am 3Ug+Rk/m26T7JiERh+dMbHMWsiNo4UZ64NTxxl5/qYYx/QdNOdkhSU1egIoY4F3aXxpQ 3Ja1d7YaO9xiH/cyc+fD7uMtZ15E+uOtbb1JaHv26CsCar8pcrDMfrBTVth37RthzrvI COj7r+8GrXoqE/62T9ozPzzXoS9zwx8hMz87uqRwhTR5N2kFQ1bG9LZBIbSmrJjAd32l rPOg== X-Gm-Message-State: ACrzQf2TDNE3Ku7VtSJCQ7df8zvNNvdmGxZBbT1shAzMJMj6nYqWZ1O6 5Zu15xnOVydngo0HmsnvsK7NDKqE7jeOBaOIcti1CCif8yY= X-Google-Smtp-Source: AMsMyM7qHXeiuI0JgH5QBqdyhGpGRRCVx+jgaaFBlTeHa+HboAEgTjGLV9A8+TBNldOH8CqDbSlQSUunHS9WdTy2vCk= X-Received: by 2002:a63:8548:0:b0:454:92b9:9379 with SMTP id u69-20020a638548000000b0045492b99379mr556612pgd.579.1665073792147; Thu, 06 Oct 2022 09:29:52 -0700 (PDT) MIME-Version: 1.0 From: Kevin Connor Arpe Date: Fri, 7 Oct 2022 01:29:40 +0900 Message-ID: Subject: Re: inotify? To: cygwin@cygwin.com Content-Type: multipart/alternative; boundary="000000000000e7e65a05ea60337c" X-Spam-Status: No, score=2.6 required=5.0 tests=BAYES_05,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,URI_TRY_3LD autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000e7e65a05ea60337c Content-Type: text/plain; charset="UTF-8" Hi, Sorry, I am a GMail user, so I am unable to reply to the original email from Eric Blake eblake@redhat.com on Thu May 3 14:03:00 GMT 2018: https://cygwin.com/pipermail/cygwin/2018-May/237069.html Eric wrote: <> First, please correct me if Linux-style inotify is already supported in Cygwin. As I understand, it is not. To be clear, when I say "inotify", I mean this Linux kernel API: https://man7.org/linux/man-pages/man7/inotify.7.html Second, I am interested in exploring this feature as a personal project. After some research, I found two different solutions on Windows: 1. FindNextChangeNotification() and friends explained here: https://learn.microsoft.com/en-us/windows/win32/fileio/obtaining-directory-change-notifications 2. (NTFS) Change Journals explained here: https://learn.microsoft.com/en-us/windows/win32/fileio/change-journals There is some discussion about both approaches on StackOverflow.com here: https://stackoverflow.com/questions/3517460/is-there-anything-like-inotify-on-windows In short, it sounds like #1 (above) is unreliable and can drop/miss file system events if too fast and/or the kernel notification queue is full/overloaded. However, #2 (above) requires journalling to be enabled on an NTFS volume. And, it sounds like this feature is *only* available on NTFS volumes. (FAT/32 & friends would need to use #1.) My thoughts & concerns: - #1 might be easier to program but if dropped events are a reality, then ... meh, not such a great feature! - #2 is restricted to NTFS, but sounds very reliable ("rock solid", one person said). However, journalling needs to be enabled. I guess the inotify API can just return an error if journaling is disabled for an NTFS volume. And, I see two solutions for non-NTFS volumes: inotify API returns error, or fall-back to #2. More: It sounds like journaling might be disabled by default. - https://stackoverflow.com/questions/27184283/is-the-usn-journal-disabled-by-default - https://devblogs.microsoft.com/oldnewthing/20130101-00/?p=5673 And enabling probably requires local admin access. Maybe some kind of flag can choose #1 or #2? I would appreciate it if people could share their thoughts and advice. The Linux inotify API is an excellent feature. I have used it a few times with great success. It would be nice to have this feature on Cygwin. Kind regards, Kevin ARPE Tokyo, Japan https://github.com/kevinarpe --000000000000e7e65a05ea60337c--