Weird behavior in WO
Weird behavior in WO
- Subject: Weird behavior in WO
- From: Frank Stock <email@hidden>
- Date: Tue, 7 Nov 2006 20:24:48 +0100
Hello,
I don't think this is directly a problem of WO. I did test this in
pure Java and this routine is working fine, we do a copy of a file,
overwriting another file.
But within WO, the old file is not overwritten and we don't get an
error or exeption, strange thing is: if we do this in debugging mode,
step-by-step it works the file is replaced.
public static boolean copyFile (String srcpath, String destpath) {
File src = new File(srcpath);
File dest = new File(destpath);
try {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dest);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
return true;
} catch (IOException e) {
NSLog.debug.appendln("DEBUG:"+e.getMessage());
return false;
}
}
Thanks,
Frank Stock
NSS production
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden