B4J Library jFileWatcher - watch system file events

John Naylor

Active Member
Licensed User
Longtime User
Can you even receive a file whilst in sleep mode? I wasn't aware that you could as I only use jfilewatcher on a permanently awake VPS
 

Roycefer

Well-Known Member
Licensed User
Longtime User
I'm not sure anything can be done while the system is sleeping. Isn't that the point of sleeping?

The jFileWatcher library uses the OS's file watching mechanisms. The library has no control over if the watching is done with polling or native file watching events.
 
ultimately i'm using the wrong tool for the job. i'm using jfilewatcher as a form of communications between computers. doing something like this "if this file exists on server then do this, or if this file exist then do that". in my case if file gate168.txt exists then change your gateway address to 192.168.168.168. if file gate167.txt exists then change your gateway address to 192.168.168.167. the server is creating files as a way to communicate with all the other computers on the network. the server from time to time checks the primary internet, if its down then it creates a file on the server (it never sleeps) to tell the other computers what to do. i thought maybe there was something you could add to the libaray but it i guess not. problem is solved for me: i use both polling and jfilewatcher. polling by using file.exists in a timer. polling is sure but jfilewatcher is fast. im done with the program and its deployed, no problems so far, i've moved on to b4j and jopencv. one day i'll have to come back to this program and add new things i'll use a better tool for the job next time. mqtt looks like it might be what i'm looking for.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…