On Thu, Jul 22, 2010 at 2:13 PM, Vimil Saju <[email protected]> wrote: > > Hi, > I was looking if the copy task had the ability to overwrite read-only files. > The manual says > that if the 'force' attribute is set to true then read-only files will be > overwritten, but it also > says this attribute is available only on ant version 1.8.2. I don't see that > version of ant > for download on the site.
Hmmm.... It looks like you may have to get the latest source code and build it yourself, or try the Hudson builds that occur on every source update. It took me a little while to locate them: Ant's Hudson project is at http://hudson.zones.apache.org/hudson/view/Ant/. If you drill down into the build and then the build artifacts, you can find the binaries. I found one here: http://bit.ly/aqWnmM. If that doesn't work, you may have to checkout the source from the Apache Ant's source repository and try building it yourself. The source repository is at: http://ant.apache.org/svn.html The thing you may want to ask yourself is why are you trying to copy over read-only files. In development situations, this is usually a warning that you're trying to do something you shouldn't be doing. For example, you have a revision control system where you have to mark files you want to modify for checking out. (Clearcase where you have to do a "cleartool co" or Perforce where you have to "p4 edit" files). In this case, you're trying to overwrite files that you really don't want to change. If you really do need to overwrite read-only files, and you can't get Ant 1.8.2 to work, you can always use Ant's "exec" command to call the operating system's command to remove the read-only attribute. In Unix/Linux, it is "chmod -R +w". In Windows, it is "attrib -r". You can verify the OS via the "exec" command with the "exec" task's "osfamily" parameter. It can be "unix", "windows" and "mac" (See http://ant-contrib.sourceforge.net/tasks/tasks/osfamily.html for more information about the possible values.). -- David Weintraub [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
