i hope i'm right assuming this will fix the latest problems:
if not, throw some rocks at me :P
this code is untested, uncompiled and not verified - UAYOR!!
check it and resubmit to support@ if you feel like it (or simply delete
this meil ;)
---~~---
patch for Main.java:
File temp = new File(Node.nodeFile+"-temp");
File outfile = new File(Node.nodeFile);
OutputStream out =
new FileOutputStream(temp);
try {
fs.writeFields(new WriteOutputStream(out));
} catch (IOException e) {
Core.logger.log(Main.class, "Cannot write node file", e,
Core.logger.ERROR);
System.err.println("Cannot write node file: "+e);
e.printStackTrace(System.err);
} finally {
out.close();
}
+ if(outfile.exists()) {
+ Core.logger.log(Main.class, "Deleting old node file
"+outfile, Core.logger.DEBUG);
+ if(!outfile.delete()) {
+ Core.logger.log(Main.class, "Cannot delete old
node file "+outfile,
+ Core.logger.ERROR);
+ System.err.println("CANNOT DELETE OLD NODE FILE
"+outfile);
+ }
+ }
+
if(!temp.renameTo(outfile)) {
Core.logger.log(Main.class, "Cannot rename "+temp+" to
"+outfile,
Core.logger.ERROR);
System.err.println("CANNOT RENAME NODE FILE "+temp+" TO
"+outfile);
}
Core.logger.log(Main.class, "Written node file",
Core.logger.DEBUG);
}
---~~---
comments on your log:
>>My log is full of the following error: Cannot rename node-temp to
>>node.
>
>It's the same at my place.
>
>Starting with NO "node" file and NO "node-temp" file the debug-level
>log starts with:
>
>27.03.2003 xx:xx:xx (freenet.support.io.Bandwidth, main, NORMAL): new
>Bandwidth(96000,0,RECEIVED)
>27.03.2003 xx:xx:xx (freenet.support.io.Bandwidth, main, NORMAL): new
>Bandwidth(10000,0,SENT)
>27.03.2003 xx:xx:xx (freenet.node.Main, main, NORMAL): loading node keys:
>X:\xxxxxxxxxxxxxxx\xxxxxxx\node
>27.03.2003 xx:xx:xx (freenet.node.Main, main, NORMAL): Creating node
>keys: X:\xxxxxxxxxxxxxxx\xxxxxxx\node
-> file "node-temp" (N_1) was created and later successfully renamed to
"node" (N_1)
>27.03.2003 xx:xx:xx (freenet.node.Main, main, ERROR): Cannot rename
>X:\xxxxxxxxxxxxxxx\xxxxxxx\node-
>temp to X:\xxxxxxxxxxxxxxx\xxxxxxx\node
-> a new file "node-temp" (N_2) was created but could not renamed to
"node" because the old "node" (N_1) file still exists
>CANNOT RENAME NODE FILE X:\xxxxxxxxxxxxxxx\xxxxxxx\node-temp TO
>X:\xxxxxxxxxxxxxxx\xxxxxxx\node
>27.03.2003 xx:xx:xx (freenet.node.Main, main, NORMAL): starting filesystem
-> again a new node-temp was created (N_3) .... but node (N_1) still
exists
>[SNIP]
>
>The files "node" and "node temp" are created but "node" is never changed!
>And therefore "ARK.revision" and "ARK.revisionInserted" will always be
>"=0". The node will have to find free ARK slots on every start-up.
-> because node is still N_1
_______________________________________________
devl mailing list
devl at freenetproject.org
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl