Don, Is this on a Unix system? I also use p4, and do lots of file copies as part of my build, and the files that are copied aren't read-only in the outdir tree. But I'm building on NT, so maybe that's the difference?
Diane --- Don Ferguson <[EMAIL PROTECTED]> wrote: > We use p4 (perforce) as our source code control system, and p4 files are > read-only > unless checked out for editing. In this case, a file from our source > tree gets > copied into the classes directory. If a "p4 sync" updates the the > source file, ant > will try to copy the updated file into the classes directory, but fail > because it is > read only. I would like a flag on copy that is the semantic equivalent > of "cp -f". > Overwrite seemed pretty close, but I'd be just as happy with "force". > I'd rather > not have to specifically delete the file, or change its file > permissions. > > -Don > > Ken Wood wrote: > > > I agree. The last thing I want is a build too > > that thinks it knows more than I do, and replaces > > files that I've gone to the trouble of protecting. > > > > If there are read only files that need to be dealt > > with, I believe the right way is for the appropriate > > files to be dealt with (chmod or whatever) by a script > > that runs PRIOR to invoking Ant. > > > > Glenn McAllister wrote: > > > > > > Conor MacNeill wrote: > > > > > > > Don, > > > > > > > > Currently, overwrite means to overwrite the file even if the > destination > > > > file is newer, not to overwrite it at all costs. I am a little > wary about > > > > overwriting read-only files. How do other people feel about this? > > > > > > I'm a big -1 on this. Usually you don't mark a file read-only > unless you have > > > a good reason to; arbirarily overwriting it by getting around the OS > file > > > protection mechanism is *not* a good idea. > > > > > > > > > > > > > > > Conor > > > > > > > > ----- Original Message ----- > > > > From: "Don Ferguson" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Tuesday, February 13, 2001 11:41 AM > > > > Subject: [PATCH] copy with overwrite > > > > > > > > > Under NT, attempts to copy over a read-only file raises a > > > > > java.io.FileNotFoundException, even with the overwrite flag > > > > > on. This patch causes the file to first be deleted if overwrite > > > > > is true, and if the destination file cannot be written. > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ===== ([EMAIL PROTECTED]) __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
