Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 18th, 2002, 02:43 PM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 15 h 7 m 10 sec
Reputation Power: 279
Question Directory polling?

I'd like to have a program (daemon, service)poll a folder and do some action on it's content.
How can I do this in java, php, python ... anything?
Thanks in advance for your help!

Reply With Quote
  #2  
Old January 18th, 2002, 11:08 PM
andnaess andnaess is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2001
Location: Oslo
Posts: 1,516 andnaess User rank is Private First Class (20 - 50 Reputation Level)andnaess User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
The easiest way is probably to write script which does this, then run it on regular intervals using cron (if on unix). I don't know what you have to use on windows, but I'm sure a similiar tool is available.
Comments on this post
JimmyGosling agrees!
BaronVonDoppleG agrees!
__________________
--
Regards
André Nęss

Puritanism: The haunting fear that someone, somewhere may be having fun

Reply With Quote
  #3  
Old January 19th, 2002, 04:35 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 15 h 7 m 10 sec
Reputation Power: 279
Well, there is plenty of such programs, but they are all commercial.
I need a service/daemon because it has to poll the directory "continuously", and I don't think that a cron that runs every 5 sec. would be right.
Do you know of any opensource project of this kind? Or a tutorial about building a service/daemon?
Regards.

Reply With Quote
  #4  
Old January 19th, 2002, 06:19 PM
iDeveloper iDeveloper is offline
Your Friend
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Posts: 9 iDeveloper User rank is Private First Class (20 - 50 Reputation Level)iDeveloper User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by pabloj
I need a service/daemon because it has to poll the directory "continuously"


So basically you want to "hook up" the OS functions manipulating with directory files (creating/modifying),etc. ?
Comments on this post
JimmyGosling agrees!
BaronVonDoppleG agrees!

Reply With Quote
  #5  
Old January 20th, 2002, 12:48 AM
andnaess andnaess is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2001
Location: Oslo
Posts: 1,516 andnaess User rank is Private First Class (20 - 50 Reputation Level)andnaess User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Well, I guess that's just a program which does something every 5 seconds and sleeps for the rest of the time... You could even use a simple PHP script for that, although it's probably better to write it in C to avoid wasting resources:
PHP Code:
while(true) {
  
//Poll directories
  
sleep(5);


Reply With Quote
  #6  
Old January 20th, 2002, 02:49 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 15 h 7 m 10 sec
Reputation Power: 279
Talking

Thanks for your help, I've even found another example in vb, but I'm gonna try with Python.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Directory polling?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT