Re: [Lazarus] Shell notifications

2013-08-22 Thread Antonio Fortuny
Hi All. I've built some code which works fine under Linux. I'm now working on the Windows part using FindFirstChangeNotificationA to get the directory handle and ReadDirectoryChangesW to fetch events data. And I'm blocked there. The receiving buffer is set to 32kb. After changing a file

Re: [Lazarus] Shell notifications

2013-08-22 Thread Antonio Fortuny
See the code in attachment I changed the code a little bit adding the OVERLAP parameter and events to use the async method. Now the same function returns error code 6 Antonio. procedure TFrmMain.StartNotify(const FolderName: String); {$IFDEF LINUX} function

Re: [Lazarus] Shell notifications

2013-08-22 Thread Sven Barth
Am 22.08.2013 13:33, schrieb Antonio Fortuny: See the code in attachment I changed the code a little bit adding the OVERLAP parameter and events to use the async method. Now the same function returns error code 6 Error code 6 is ERROR_INVALID_HANDLE (would be nice if you'd mention the error

Re: [Lazarus] Shell notifications

2013-08-22 Thread Henry Vermaak
On Thu, Aug 22, 2013 at 01:49:28PM +0200, Sven Barth wrote: Am 22.08.2013 13:33, schrieb Antonio Fortuny: See the code in attachment I changed the code a little bit adding the OVERLAP parameter and events to use the async method. Now the same function returns error code 6 Error code 6 is

Re: [Lazarus] Shell notifications

2013-08-22 Thread Antonio Fortuny
Le 22/08/2013 14:06, Henry Vermaak a écrit : On Thu, Aug 22, 2013 at 01:49:28PM +0200, Sven Barth wrote: Am 22.08.2013 13:33, schrieb Antonio Fortuny: See the code in attachment I changed the code a little bit adding the OVERLAP parameter and events to use the async method. Now the same

Re: [Lazarus] Shell notifications

2013-08-21 Thread Michael Schnell
On 08/20/2013 02:56 PM, Henry Vermaak wrote: ... together with select().. In Object Pascal I think this should be encapsulated in a thread and same fires a main Thread event (via TThread.Queue, TThread.Synchronize, or Application.QueueAsyncCall) to notify the user (aka Main Thread).

Re: [Lazarus] Shell notifications

2013-08-21 Thread Mark Morgan Lloyd
Michael Schnell wrote: On 08/20/2013 02:56 PM, Henry Vermaak wrote: ... together with select().. In Object Pascal I think this should be encapsulated in a thread and same fires a main Thread event (via TThread.Queue, TThread.Synchronize, or Application.QueueAsyncCall) to notify the user

Re: [Lazarus] Shell notifications

2013-08-21 Thread Henry Vermaak
On Wed, Aug 21, 2013 at 12:36:56PM +, Mark Morgan Lloyd wrote: Michael Schnell wrote: On 08/20/2013 02:56 PM, Henry Vermaak wrote: ... together with select().. In Object Pascal I think this should be encapsulated in a thread and same fires a main Thread event (via TThread.Queue,

Re: [Lazarus] Shell notifications

2013-08-21 Thread Michael Schnell
On 08/21/2013 02:36 PM, Mark Morgan Lloyd wrote: I know it's the obvious way, but surely there is something more elegant than having a thread which exists solely to transfer the result of a select() to the main part of the app, and then repeats I suppose a thread is the only way to do this

Re: [Lazarus] Shell notifications

2013-08-21 Thread Mark Morgan Lloyd
Michael Schnell wrote: On 08/21/2013 02:36 PM, Mark Morgan Lloyd wrote: I know it's the obvious way, but surely there is something more elegant than having a thread which exists solely to transfer the result of a select() to the main part of the app, and then repeats I suppose a thread is

Re: [Lazarus] Shell notifications

2013-08-21 Thread Flávio Etrusco
On Wed, Aug 21, 2013 at 9:36 AM, Mark Morgan Lloyd markmll.laza...@telemetry.co.uk wrote: Michael Schnell wrote: On 08/20/2013 02:56 PM, Henry Vermaak wrote: ... together with select().. In Object Pascal I think this should be encapsulated in a thread and same fires a main Thread event

[Lazarus] Shell notifications

2013-08-20 Thread Antonio Fortuny
Hi Folks. Do you know any component / tool to allow an application to be notified by the host OS when something changes in a disk directory ? Both Windows Linux. Thanks, Antonio. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] Shell notifications

2013-08-20 Thread Mark Morgan Lloyd
Antonio Fortuny wrote: Hi Folks. Do you know any component / tool to allow an application to be notified by the host OS when something changes in a disk directory ? Both Windows Linux. I think on Linux that you need something like the File Alteration Monitor (FAM) daemon, but I don't know

Re: [Lazarus] Shell notifications

2013-08-20 Thread Michael Van Canneyt
On Tue, 20 Aug 2013, Mark Morgan Lloyd wrote: Antonio Fortuny wrote: Hi Folks. Do you know any component / tool to allow an application to be notified by the host OS when something changes in a disk directory ? Both Windows Linux. I think on Linux that you need something like the File

Re: [Lazarus] Shell notifications

2013-08-20 Thread Henry Vermaak
On Tue, Aug 20, 2013 at 02:22:02PM +0200, Antonio Fortuny wrote: Hi Folks. Do you know any component / tool to allow an application to be notified by the host OS when something changes in a disk directory ? Both Windows Linux. inotify on linux (together with select()). I'm told

Re: [Lazarus] Shell notifications

2013-08-20 Thread Antonio Fortuny
Le 20/08/2013 14:56, Henry Vermaak a écrit : On Tue, Aug 20, 2013 at 02:22:02PM +0200, Antonio Fortuny wrote: Hi Folks. Do you know any component / tool to allow an application to be notified by the host OS when something changes in a disk directory ? Both Windows Linux. inotify on linux

Re: [Lazarus] Shell notifications

2013-08-20 Thread Henry Vermaak
On Tue, Aug 20, 2013 at 03:21:01PM +0200, Antonio Fortuny wrote: Le 20/08/2013 14:56, Henry Vermaak a écrit : On Tue, Aug 20, 2013 at 02:22:02PM +0200, Antonio Fortuny wrote: Hi Folks. Do you know any component / tool to allow an application to be notified by the host OS when something

Re: [Lazarus] Shell notifications

2013-08-20 Thread Antonio Fortuny
Le 20/08/2013 15:46, Henry Vermaak a crit: On Tue, Aug 20, 2013 at 03:21:01PM +0200, Antonio Fortuny wrote: Le 20/08/2013 14:56, Henry Vermaak a crit : On Tue, Aug 20, 2013 at 02:22:02PM +0200, Antonio Fortuny wrote: