public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: inotify?
@ 2022-10-06 16:29 Kevin Connor Arpe
  2022-10-06 19:58 ` inotify? Ken Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Connor Arpe @ 2022-10-06 16:29 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2585 bytes --]

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: <<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

^ permalink raw reply	[flat|nested] 7+ messages in thread
* inotify?
@ 2018-05-03  9:35 Ulli Horlacher
  2018-05-03 10:37 ` inotify? Richard H Lee
  0 siblings, 1 reply; 7+ messages in thread
From: Ulli Horlacher @ 2018-05-03  9:35 UTC (permalink / raw)
  To: cygwin

I have written a program, which uses inotify(wait) to send new created or
modified files.
Since inotify is a Linux kernel service, my program does not run with
Cygwin.
Is there a similar service "tell me of new files in this directory tree" 
in Windows which I can use instead?

-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20180503093514.GA31178@rus.uni-stuttgart.de>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-23 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 16:29 inotify? Kevin Connor Arpe
2022-10-06 19:58 ` inotify? Ken Brown
2022-10-23 12:13   ` inotify? Kevin Connor Arpe
  -- strict thread matches above, loose matches on Subject: below --
2018-05-03  9:35 inotify? Ulli Horlacher
2018-05-03 10:37 ` inotify? Richard H Lee
2018-05-03 14:03   ` inotify? Eric Blake
2018-05-03 21:47   ` inotify? Ulli Horlacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).