For Programmers: Free Programming Magazines  


Home > Archive > Clarion > October 2004 > check for new text files periodically









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author check for new text files periodically
lai

2004-08-30, 4:43 am

I am trying to write some code that will search certain folder(eg. D:\Incoming\) for new text files periodically(eg. every one minute). If a new text file is found, it will retrieve the data of the file and run a procedure. Can somebody tell me is this possible and if yes, how to do it?

Thanks!
kgc

2004-08-31, 3:55 am

lai wrote:
> I am trying to write some code that will search certain folder(eg.
> D:\Incoming\) for new text files periodically(eg. every one minute). If
> a new text file is found, it will retrieve the data of the file and run
> a procedure. Can somebody tell me is this possible and if yes, how to
> do it?

It is possible.

Simply place a timer (Prop:Timer) on your window, and do whatever you
need to on Event:Timer. You can consider letting the timed window start
a new thread to process the data, so that the timer-window can go on. In
some situations (when the things you do on the timer window, can happen
to take longer than the timer-interval), it is best to turn off the
timer (window{Prop:Timer} = 0) while you process the Event:Timer, and
then turn the timer on again, to prevent a Event-queue to build up.

You can use "Directory" to list files in a given location. or "Exists"
to check existens of a file with a known name.

Hope this helps

Kasper

--
Besøg mig på nettet: http://www.kaspershjemmeside.dk
kgc

2004-09-08, 8:55 am

lai wrote:
> I am trying to write some code that will search certain folder(eg.
> D:\Incoming\) for new text files periodically(eg. every one minute). If
> a new text file is found, it will retrieve the data of the file and run
> a procedure. Can somebody tell me is this possible and if yes, how to
> do it?

It is possible.

Simply place a timer (Prop:Timer) on your window, and do whatever you
need to on Event:Timer. You can consider letting the timed window start
a new thread to process the data, so that the timer-window can go on. In
some situations (when the things you do on the timer window, can happen
to take longer than the timer-interval), it is best to turn off the
timer (window{Prop:Timer} = 0) while you process the Event:Timer, and
then turn the timer on again, to prevent a Event-queue to build up.

You can use "Directory" to list files in a given location. or "Exists"
to check existens of a file with a known name.

Hope this helps

Kasper

--
Besøg mig på nettet: http://www.kaspershjemmeside.dk
lai

2004-10-06, 5:56 am

Thanks. I have got the timer function working. But i got invalid function label for "exists" when i compile the program in clarion 4, the word doesn't turn blue as like other label. What i need is to check the existen of file starting with "ver" and end with file extension "txt", eg. "ver1234.txt". Any idea?

Lai
lai

2004-10-12, 9:20 pm

I got invalid function label for "exists" when i compile the program in clarion 4, the word doesn't turn blue as like other label. What i need is to check the existence of file starting with "ver" and end with file extension "txt", eg. "ver1234.txt". And can I use "ver*.txt" for the checking? Any idea?

Lai [/B][/QUOTE]
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com