Remote Folding Status Servlet
Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee
Remote Folding Status Servlet
Is there any way for the folding client to pass information to other programs? I'm running Apache Tomcat and would like to create a servlet that would let me see my folding progress on the web so I can track it when I'm not at home.
If anybody wants to collaborate on this, let me know. I'll probably be doing some brainstorming on it for the next few days.
If anybody wants to collaborate on this, let me know. I'll probably be doing some brainstorming on it for the next few days.
Update: I wrote a simple JSP to put the contents of the log on a web page. As soon as I ran it the first time, I couldn't finish any more frames in my FAH Console. Processor usage was still 100%, but the darn thing ran for 50 minutes without finishing a frame. I ran the graphical client to see if anything would be different there, and it locked up my machine. Upon rebooting everything seems to work.
I'm betting my problem is the one I mentioned earlier with 2 programs trying to access the file at the same time.
I'll probably make a temporary copy of the file when the JSP is accessed instead of opening the original log. Any other ideas/suggestions?
I'm betting my problem is the one I mentioned earlier with 2 programs trying to access the file at the same time.
I'll probably make a temporary copy of the file when the JSP is accessed instead of opening the original log. Any other ideas/suggestions?
-
- *Lifetime Patron*
- Posts: 1465
- Joined: Sun Mar 09, 2003 12:27 pm
- Location: Reading.England.EU
Did you see Electron Microscope seems to have a last page of options that seem to build a complete web page? And/or will even act as a web server? Haven't tried it myself.
I haven't looked at it. Creating a webpage would be nice ... I don't want it to run as a webserver because Tomcat is already taking port 80. Thanks for the tip!
PS - I got my JSP to work. Here's the code for anybody who's interested:
Edited to reflect FAHlog.txt:
Really simple ... just displays the contents of the log file.
PS - I got my JSP to work. Here's the code for anybody who's interested:
Edited to reflect FAHlog.txt:
Code: Select all
<%@ page language="java" import="java.io.*" %>
<HTML>
<HEAD>
<TITLE>Folding@Home Status</TITLE>
</HEAD>
<BODY>
<FONT FACE="Courier New" Size="-1">
<%
Runtime.getRuntime().exec("cmd /c copy \"C:\\Program Files\\Folding@Home\\FAHlog.txt\" \"C:\\Program Files\\Folding@Home\\templog.txt\"").waitFor();
File logFile = new File("C:\\Program Files\\Folding@Home\\templog.txt");
String tempStr = " ";
try {
BufferedReader in = new BufferedReader(new FileReader(logFile));
while (tempStr != null){
out.println(tempStr + "<BR>");
tempStr = in.readLine();
}
} catch (IOException e) {
}
logFile.delete();
%>
</FONT>
</BODY>
</HTML>
Last edited by dgouldin on Thu May 01, 2003 1:55 pm, edited 1 time in total.
Erm, I hate to say this to you but the filename of the logfile changes with every WU. FAH has a queue for 10 workunits, dunno why but it's there (in the graphical version, right-click on the icon, ->status->queue info). The 03 in the logfile's filename is slot# in the queue, it can range from 00 to 09.
You can use the FAHlog.txt file, perhaps your locking problem is gone then as well.
You can use the FAHlog.txt file, perhaps your locking problem is gone then as well.
Thanks for the heads up. That file has a lot more information I can do cool stuff with. It will have the same copy problem, but I'm not worried about that. I'll develop it over the next few days and let you guys know what I come up with.
Even if there is something already in Electron Microscope, using it wouldn't be nearly as much fun as this is. (aren't I a nerd?)
Even if there is something already in Electron Microscope, using it wouldn't be nearly as much fun as this is. (aren't I a nerd?)