Page 1 of 1

StartNotify / EndNotify

Posted: Tue Dec 18, 2018 10:53 am
by lazi
Is it possible a platform wide support of file change notification?

As Amiga does it via dos.library/StartNotify, EndNotify.

dos.library/StartNotify dos.library/StartNotify

NAME
StartNotify -- Starts notification on a file or directory. (V36)

SYNOPSIS
int32 success = StartNotify(struct NotifyRequest *notifystructure);

FUNCTION
Posts a notification request. Do not modify the notify structure
while it is active. You will be notified when the file or directory
changes. For files, you will be notified after the file is closed.
Not all filesystems will support this: applications should NOT
require it. In particular, most network filesystems won't support it.

Re: StartNotify / EndNotify

Posted: Thu Dec 27, 2018 12:33 pm
by airsoftsoftwair
Hmm, what on earth do you need this for? :)

Re: StartNotify / EndNotify

Posted: Thu Dec 27, 2018 2:07 pm
by lazi
Hello Andreas!

I am often using my own image viewer which has a thumbnail strip. When an image is edited externally for example with ImageFX and saved back to the same file the questioned feature should let the imageviewer automatically reload the changed image for displaying and adapting thumbnail.

However other use cases may be imaginable. :)

Do not know how other systems can benefit from such thing, especially because my rough experiences tells me that on 'other' systems a file keeping opened is a widespread habit.

Re: StartNotify / EndNotify

Posted: Thu Dec 27, 2018 8:15 pm
by jPV
I can see some cases it would be handy.

I've been asked to code some sort of filemanager and there it would be needed to see if the displayed directory is changed (never promised to do it though, but maybe someone else would at least). Or if doing some sort of checks if something needs processing, for example, if you want to process files appearing in a download dir, or anything similar... notify would be more elegant than periodical polling. Or for info screen kind of displays which could update their displays when datafiles get changed etc (score boards etc)...

BTW. MorphOS got the WaitForNotification shell command in the 3.10 update this year, and it's a handy command.. and built-in command in Hollywood would be even more handy :)

Re: StartNotify / EndNotify

Posted: Thu Dec 27, 2018 11:29 pm
by airsoftsoftwair
Well, on Amigaoids, Windows, and macOS this is probably not too difficult to implement, but then there's always Linux of course :roll:

Re: StartNotify / EndNotify

Posted: Sat Jan 19, 2019 5:45 pm
by airsoftsoftwair
Well, here are you, now go and write a file manager with Hollywood :)

Code: Select all

- New: Added MonitorDirectory() function; this allows you to monitor all changes in a directory and get
  notified as soon as something changes through the new "DirectoryChanged" listener that you can install
  using InstallEventHandler(); note that this function might not work correctly on network drives

Re: StartNotify / EndNotify

Posted: Tue Jan 22, 2019 6:42 pm
by r-tea
Looks like the new version is closer than we think :)