ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SHAILJA <shalja.ru...@gmail.com>
Subject Re: Ant1.8 copy task gives error "Failed to copy" with "Permission denied"
Date Fri, 07 May 2010 08:52:38 GMT

Hi Stefan,

I tried to debug my problem with small example. It seems something has
changed in "copy" target with ant1.8.0. We change permission of destination
file after copy. With ant-1.7.1 copy target copied the source file if source
file is newer than destination file but with ant-1.8.0 copy target failed. 

My small build.xml is
==============
/u/kumari/ant> less less build.xml
<project>
<target name="install_scripts">
 <copy file="${basedir}/myfile.txt" tofile="/u/kumari/myfile.txt"/>
 <chmod file="/u/kumari/myfile.txt" perm="555"/>
</target>
 </project>
================
 
Result with ant1.7.1
=================
/u/kumari/ant> /apache/ant-1.7.1/bin/ant install_scripts
Buildfile: build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD SUCCESSFUL
Total time: 0 seconds

/u/kumari> ls -alh myfile.txt
-r-xr-xr-x   1 kumari   kumari         0 May  7 04:33 myfile.txt

/u/kumari/ant> touch myfile.txt
/u/kumari/ant> ls -alh myfile.txt
-rw-rw-r--   1 kumari   kumari         0 May  7 04:35 myfile.txt
/u/kumari/ant> /apache/ant-1.7.1/bin/ant install_scripts
Buildfile: build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD SUCCESSFUL
Total time: 0 seconds

/u/kumari> ls -alh myfile.txt
-r-xr-xr-x   1 kumari   kumari         0 May  7 04:35 myfile.txt

=========================
Result with ant-1.8.0
====================
/u/kumari> ls -alh myfile.txt
myfile.txt: No such file or directory

kumari@invest2.nyc:/u/kumari/ant> /apache/ant-1.8.0/bin/ant install_scripts
Buildfile: /u/kumari/ant/build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD SUCCESSFUL
Total time: 0 seconds

/u/kumari> ls -alh myfile.txt
-r-xr-xr-x   1 kumari   kumari         0 May  7 04:40 myfile.txt

/u/kumari/ant> touch myfile.txt
/u/kumari/ant> ls -alh myfile.txt
-rw-rw-r--   1 kumari   kumari         0 May  7 04:41 myfile.txt
/u/kumari/ant> /apache/ant-1.8.0/bin/ant install_scripts
Buildfile: /u/kumari/ant/build.xml

install_scripts:
     [copy] Copying 1 file to /u/kumari

BUILD FAILED
/u/kumari/ant/build.xml:5: Failed to copy /u/kumari/ant/myfile.txt to
/u/kumari/myfile.txt due to java.io.FileNotFoundException
/u/kumari/myfile.txt (Permission denied)

Total time: 0 seconds

/u/kumari/ant> 
/u/kumari> ls -alh myfile.txt
myfile.txt: No such file or directory









Stefan Bodewig wrote:
> 
> On 2010-04-08, SHAILJA <shalja.rudra@gmail.com> wrote:
> 
>> When I  use ant1.8.0, it gives error like this
> 
>> Failed to copy /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
>> to
>> /u/kumari/main/base/bin/share/run_m.pl due to
>> java.io.FileNotFoundException
>> /u/kumari/main/shailja/bin/share/run_m.pl (Permission denied)
> 
>> But I have file /u/kumari/main/shailja/src/java/a/jsh/mm/script/run_m.pl
>> with correct permission.
> 
> The error is about /u/kumari/main/shailja/bin/share/run_m.pl not the
> file you mention.  Could there be a symbolic link somewhere that Ant
> tries to traverse but can't?
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Ant1.8-copy-task-gives-error-%22Failed-to-copy%22-with-%22Permission-denied%22-tp28179282p28483682.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message