delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/10/06/12:30:51

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
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
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 <kevinarpe AT gmail DOT com>
Date: Fri, 7 Oct 2022 01:29:40 +0900
Message-ID: <CAFMYRRNfM8AOD26q3UbHmwpGyG=WnE7LM8cYJt3=V5Tjfm7vRw@mail.gmail.com>
Subject: Re: inotify?
To: cygwin AT cygwin DOT com
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
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Hi,

Sorry, I am a GMail user, so I am unable to reply to the original email
from Eric Blake eblake AT redhat DOT com on Thu May 3 14:03:00 GMT 2018:
https://cygwin.com/pipermail/cygwin/2018-May/237069.html

Eric wrote: <<And patches to make Cygwin support inotify_init() and
friends implemented
on top of the Windows native API are certainly welcome.>>

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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019