• 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
Re: Weird behavior in WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird behavior in WO


  • Subject: Re: Weird behavior in WO
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 7 Nov 2006 11:31:38 -0800

By "within WO" do you mean when the application is deployed? It sounds like a permissions problem for the user that the application is running under. When you are debugging, it is running under a different user.

Chuck

On Nov 7, 2006, at 11:24 AM, Frank Stock wrote:

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:
40global-village.net


This email sent to email@hidden


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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: Frank Stock <email@hidden>
References: 
 >Weird behavior in WO (From: Frank Stock <email@hidden>)

  • Prev by Date: Weird behavior in WO
  • Next by Date: Re: Weird behavior in WO
  • Previous by thread: Weird behavior in WO
  • Next by thread: Re: Weird behavior in WO
  • Index(es):
    • Date
    • Thread