java - JNotify and File Reader conflicting each other -
java - JNotify and File Reader conflicting each other -
i implemented jnotify determine when new file arrives in particular directory, and, when file arrives, send filename on function, follows:
public class filedetector { messageprocessor mp; class listener implements jnotifylistener { public void filecreated(int wd, string rootpath, string name) { print("created " + rootpath + " : " + name); mp.processmessage(rootpath + "\\" + name); } } }
the function mp.processmessage tries open file, maintain getting error file in utilize process. however, file has been created, other process might using jnotify.
i set couple of print statements, , appears function mp.processmessage beingness called before listener's print function. have suggestion how might resolve this, beyond putting entire message processing within listener class?
@eile think 1 process copying file, trying read it, 100 ms delay finish re-create first n can read file easily.
java jnotify
Comments
Post a Comment