Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: ShellNotify Component



Permlink Replies: 19 - Last Post: Apr 23, 2015 8:34 PM Last Post By: Francisco Alvar...
Francisco Alvar...

Posts: 83
Registered: 11/10/06
ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2015 12:09 PM
I'm looking for a component (free or paid) to scan a folder an be
notified when a new file is saved in that folder. Of course I need the
name of the file.
I have LMD ShellNotify component but it only notifies when the file is
copied to the folder, failing to notify when an external application
writes a file in that folder.
Any recommendations will be greatly appreciated.
Best Regards
Francisco Alvarado
Peter Aschbacher

Posts: 8
Registered: 10/10/99
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2015 5:52 PM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco Alvarado wrote:
I'm looking for a component (free or paid) to scan a folder an be
notified when a new file is saved in that folder. Of course I need the
name of the file.
I have LMD ShellNotify component but it only notifies when the file is
copied to the folder, failing to notify when an external application
writes a file in that folder.
Any recommendations will be greatly appreciated.
Best Regards
Francisco Alvarado

TJamShellChangeNotifier
http://www.jam-software.com/shellbrowser_delphi/miscellaneous-delphi-components.shtml
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2015 8:29 PM   in response to: Peter Aschbacher in response to: Peter Aschbacher
On 04/21/2015 6:52 PM, Peter Aschbacher wrote:
Francisco Alvarado wrote:
I'm looking for a component (free or paid) to scan a folder an be
notified when a new file is saved in that folder. Of course I need the
name of the file.
I have LMD ShellNotify component but it only notifies when the file is
copied to the folder, failing to notify when an external application
writes a file in that folder.
Any recommendations will be greatly appreciated.
Best Regards
Francisco Alvarado

TJamShellChangeNotifier
http://www.jam-software.com/shellbrowser_delphi/miscellaneous-delphi-components.shtml
Thank you Peter, I tested the demo but it can't notify about a file
created in a folder in a networked PC. I only notifies if I copy or
move, but not when an external application creates the file.
Notifications about folder updates work fine, but I need the file name.
The demo must run in the computer watched to work.
I sent a mail to their support department and I'm waiting response.
Best Regards
Matthew Jones

Posts: 337
Registered: 1/25/98
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 1:07 AM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco Alvarado wrote:

It only notifies if I copy or
move, but not when an external application creates the file.

Isn't this a known issue with Windows notifications? We learned long
ago to not trust the notifications as it is not reliable. The only way
we found was to do a findfirst/next over the location.
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 7:03 AM   in response to: Matthew Jones in response to: Matthew Jones
On 04/22/2015 2:07 AM, Matthew Jones wrote:
Francisco Alvarado wrote:

It only notifies if I copy or
move, but not when an external application creates the file.

Isn't this a known issue with Windows notifications? We learned long
ago to not trust the notifications as it is not reliable. The only way
we found was to do a findfirst/next over the location.
Thank you Matthew, I was trying to find a more efficient way to process
the last created created file (a xml file and I need to create a record
in a SQL table). Every 5-10 seconds (with some pauses) a new file is
created and at the end of the day there are about 10,000 files in that
folder. I don't want to parse every single file, just the last (new),
Any idea how to do this?
Best Regards
Francisco Alvarado
Matthew Jones

Posts: 337
Registered: 1/25/98
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 7:49 AM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco Alvarado wrote:

at the end of the day there are about 10,000 files in that
folder. I don't want to parse every single file, just the last (new),
Any idea how to do this?

Hmm, I think the answer is "I wouldn't start from here". 8-)

What I do in my scanner is have two TStringLists, A and B. Every file
that is found is added to B, and checked to see if it is in A. If not
in A, then it is processed. When all files are done, move B to A (which
clears out files that are no longer there too). Repeat as often as you
wish. (A is also stored on disk, to survive restarts, but that's a
detail.)

However, 10,000 files will soon cause a long scan time, probably more
than 5 seconds. Ideally you could move the files to another location
once processed, so that you can scan quickly (and then don't need the
lists). If you can scan for specific extensions like *.WRK, then a
simple rename would work, but if you need to get clever then you end up
with . and that means everything is scanned again.

I don't think there is a nice and easy solution, but I use each of
these in various applications, and keeping them simple does help.
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 8:00 AM   in response to: Matthew Jones in response to: Matthew Jones
On 04/22/2015 8:49 AM, Matthew Jones wrote:
However, 10,000 files will soon cause a long scan time, probably more
than 5 seconds. Ideally you could move the files to another location
once processed, so that you can scan quickly (and then don't need the
lists). If you can scan for specific extensions like *.WRK, then a
simple rename would work, but if you need to get clever then you end up
with . and that means everything is scanned again.

I don't think there is a nice and easy solution, but I use each of
these in various applications, and keeping them simple does help.
Thank you again Matthew, I'll try to adapt your suggestion to my needs
and limitations (I can't move/delete the files on the remote folder).
Best Regards
Francisco Alvarado
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 8:00 AM   in response to: Matthew Jones in response to: Matthew Jones
On 04/22/2015 8:49 AM, Matthew Jones wrote:
However, 10,000 files will soon cause a long scan time, probably more
than 5 seconds. Ideally you could move the files to another location
once processed, so that you can scan quickly (and then don't need the
lists). If you can scan for specific extensions like *.WRK, then a
simple rename would work, but if you need to get clever then you end up
with . and that means everything is scanned again.

I don't think there is a nice and easy solution, but I use each of
these in various applications, and keeping them simple does help.
Thank you again Matthew, I'll try to adapt your suggestion to my needs
and limitations (I can't move/delete the files on the remote folder).
Best Regards
Francisco Alvarado
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 8:02 AM   in response to: Matthew Jones in response to: Matthew Jones
On 04/22/2015 8:49 AM, Matthew Jones wrote:
However, 10,000 files will soon cause a long scan time, probably more
than 5 seconds. Ideally you could move the files to another location
once processed, so that you can scan quickly (and then don't need the
lists). If you can scan for specific extensions like *.WRK, then a
simple rename would work, but if you need to get clever then you end up
with . and that means everything is scanned again.

I don't think there is a nice and easy solution, but I use each of
these in various applications, and keeping them simple does help.
Thank you again Matthew, I'll try to adapt your suggestion to my needs
and limitations (I can't move/delete the files on the remote folder).
Best Regards
Francisco Alvarado
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 8:02 AM   in response to: Matthew Jones in response to: Matthew Jones
On 04/22/2015 8:49 AM, Matthew Jones wrote:
... simple rename would work, but if you need to get clever then you end up
with . and that means everything is scanned again.

I don't think there is a nice and easy solution, but I use each of
these in various applications, and keeping them simple does help.
Thank you again Matthew, I'll try to adapt your suggestion to my needs
and limitations (I can't move/delete the files on the remote folder).
Best Regards
Francisco Alvarado
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 8:03 AM   in response to: Matthew Jones in response to: Matthew Jones
On 04/22/2015 8:49 AM, Matthew Jones wrote:
... simple rename would work, but if you need to get clever then you end up
with . and that means everything is scanned again.

I don't think there is a nice and easy solution, but I use each of
these in various applications, and keeping them simple does help.
Thank you again Matthew, I'll try to adapt your suggestion to my needs
and limitations (I can't move/delete the files on the remote folder).
Best Regards
Francisco Alvarado
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 8:04 AM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco

Is there a naming convention for the files?

Roy Lambert

Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 2:18 PM   in response to: Roy Lambert in response to: Roy Lambert
On 04/22/2015 9:04 AM, Roy Lambert wrote:
Is there a naming convention for the files?
Roy Lambert
Roy:
They have the IP address of the PC that created them followed by random
characters, something like 123.542.52.123lklanfdkajnk.xml. In that
folder there are only files that I must process. The folder changes
every day, and that isn't a problem.
The task is to detect only the last one to avoid processing all for
append it to a table.
Nice task, eh?
Best Regards.
Francisco Alvarado
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2015 2:58 AM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco

They have the IP address of the PC that created them followed by random
characters, something like 123.542.52.123lklanfdkajnk.xml.

I'd hoped that there might be some sensible naming scheme you could use. Nothing much there though.

If its the latest per IP address rather than the latest you could look at using threads.

Roy
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 2:18 PM   in response to: Roy Lambert in response to: Roy Lambert
On 04/22/2015 9:04 AM, Roy Lambert wrote:
Is there a naming convention for the files?
Roy Lambert
Roy:
They have the IP address of the PC that created them followed by random
characters, something like 123.542.52.123lklanfdkajnk.xml. In that
folder there are only files that I must process. The folder changes
every day, and that isn't a problem.
The task is to detect only the last one to avoid processing all for
append it to a table.
Nice task, eh?
Best Regards.
Francisco Alvarado
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 2:22 PM   in response to: Peter Aschbacher in response to: Peter Aschbacher
I'm sorry for posting several time the same message, but my internet
connection is failing.
Francisco Alvarado
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2015 2:12 AM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco

I'm sorry for posting several time the same message, but my internet
connection is failing.

Don't worry - we all get hiccoughs from time to time

Roy
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 11:41 AM   in response to: Francisco Alvar... in response to: Francisco Alvar...
Francisco Alvarado wrote:

I'm looking for a component (free or paid) to scan a folder an be
notified when a new file is saved in that folder. Of course I need
the name of the file.
I have LMD ShellNotify component but it only notifies when the file
is copied to the folder, failing to notify when an external
application writes a file in that folder.

That is unfortunately normal, shell notifiers only work reliably on a
local folder. Even an open Explorer window often fails to detect a new
file created on the network folder it shows by an external program.
Seems to depend a bit on the server hosting the folder, the OS it uses,
whether it is actually a server farm and not a single server, and so on.


--
Peter Below (TeamB)

Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2015 2:20 PM   in response to: Peter Below in response to: Peter Below
On 04/22/2015 12:41 PM, Peter Below wrote:
That is unfortunately normal, shell notifiers only work reliably on a
local folder. Even an open Explorer window often fails to detect a new
file created on the network folder it shows by an external program.
Seems to depend a bit on the server hosting the folder, the OS it uses,
whether it is actually a server farm and not a single server, and so on.
Thank you Peter, I now realize that, so I'm looking for workarounds.
Best Regards
Francisco Alvarado
Francisco Alvar...

Posts: 83
Registered: 11/10/06
Re: ShellNotify Component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2015 8:34 PM   in response to: Francisco Alvar... in response to: Francisco Alvar...
On 04/21/2015 1:09 PM, Francisco Alvarado wrote:
Any recommendations will be greatly appreciated.
Best Regards
Francisco Alvarado
I just ended using FindFirst/FindNext loop and it works fine so far
Thank you all for your help.
Best Regards
Francisco Alvarado
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02