tag:blogger.com,1999:blog-90499873823464032.post3684500211701737754..comments2023-12-03T19:24:52.434-08:00Comments on Chamara's Blog: How to write Java code to listen runtime changes in text file....http://www.blogger.com/profile/05686852268207868825noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-90499873823464032.post-79617053201062356092011-04-27T05:17:39.143-07:002011-04-27T05:17:39.143-07:00There is also a FileListener in JNA packages that ...There is also a FileListener in JNA packages that uses native function. In my project we had many time similar requirements, Java7 was not available and we couldn't use JNA. We wrote our own FileListener, using file last modification time was the best solution we found.Loaknoreply@blogger.comtag:blogger.com,1999:blog-90499873823464032.post-40236763344805302062011-04-26T16:20:16.120-07:002011-04-26T16:20:16.120-07:00Good code. However, I agree with others. Also, t...Good code. However, I agree with others. Also, there is a Java project called JNotify that can be useful here. http://jnotify.sourceforge.net/<br /><br />---<br />Josef B.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-90499873823464032.post-45124411818355426622011-04-26T07:08:24.402-07:002011-04-26T07:08:24.402-07:00When I saw title of your blog I got surprised by n...When I saw title of your blog I got surprised by name "Chamara Silva" I thought its cricket from SriLanka :) <br />anyway nice post .<br /><br />Javin<br /><a href="http://javarevisited.blogspot.com/2011/04/garbage-collection-in-java.html" rel="nofollow">How Garbage collection works in Java </a>javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-90499873823464032.post-1673161341217920052011-04-26T05:47:52.699-07:002011-04-26T05:47:52.699-07:00Why not just use some notify syscall? ( Inotify, K...Why not just use some notify syscall? ( Inotify, Kqueue ) to monitor for changes ?niedbalskihttps://www.blogger.com/profile/04042898630493710935noreply@blogger.comtag:blogger.com,1999:blog-90499873823464032.post-38701369198978164702011-04-26T02:07:52.412-07:002011-04-26T02:07:52.412-07:00@techboard, It would implement easily using channe...@techboard, It would implement easily using channel of new java nio concept.javaamthohttps://www.blogger.com/profile/17846500204539685213noreply@blogger.comtag:blogger.com,1999:blog-90499873823464032.post-32979728666615352912011-04-26T00:37:11.341-07:002011-04-26T00:37:11.341-07:00Even prior to Java 7, I would consider to check th...Even prior to Java 7, I would consider to check the file's modification date before going to read the contents.<br /><br />In conjuction with http://code.google.com/p/google-diff-match-patch/, one could then easily find out "what" was actually changed.Unknownhttps://www.blogger.com/profile/00564147003585945713noreply@blogger.comtag:blogger.com,1999:blog-90499873823464032.post-72299936002003474822011-04-25T14:38:42.807-07:002011-04-25T14:38:42.807-07:00I believe its much easier in Java 7 using NIO (htt...I believe its much easier in Java 7 using NIO (http://download.oracle.com/javase/tutorial/essential/io/notification.html)Anonymousnoreply@blogger.com