• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Weird behavior in WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Weird behavior in WO
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Oracle and NVARCHAR2 with WO/EOF?
  • Next by Date: Re: Weird behavior in WO
  • Previous by thread: Oracle and NVARCHAR2 with WO/EOF?
  • Next by thread: Re: Weird behavior in WO
  • Index(es):
    • Date
    • Thread