ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18886] New: - Move files deletes directory if the directory is empty
Date Wed, 09 Apr 2003 23:14:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18886>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18886

Move files deletes directory if the directory is empty

           Summary: Move files deletes directory if the directory is empty
           Product: Ant
           Version: 1.5.3
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: surendra.naidu@vodafone-us.com
                CC: surendra.naidu@vodafone-us.com


move task:
When trying to backup old tar files, I found that if the directory is empty, 
the directory is getting deleted. If the directory is not empty it works fine.

I am attaching the xml file and the output for both conditions.
<?xml version="1.0" encoding="iso-8859-1"?>

<project name="test" basedir="." default="move_files">

  <target name="move_files"
          description="Back up the old build files.">
    <mkdir dir="${TEST.ROOT.DIR}/build/builds"/>
    <move todir="${TEST.ROOT.DIR}/build/builds"
          verbose="false">
          <fileset dir="${TEST.ROOT.DIR}/build"> 
		<include name="**/*.tar.gz"/>
          </fileset>
    </move>
  </target>
</project>


surendrn@dedapp4 bash$ ls -l test/build/
total 0
surendrn@dedapp4 bash$ ant -v -f test.xml -DTEST.ROOT.DIR=/tmp/test 
Apache Ant version 1.5.3 compiled on April 9 2003
Buildfile: test.xml
Detected Java version: 1.3 in: /vgp/shared/jdk/j2sdk1_3_1_04/jre
Detected OS: SunOS
parsing buildfile test.xml with URI = file:/tmp/test.xml
Project base dir set to: /tmp
Build sequence for target `move_files' is [move_files]
Complete build sequence is [move_files]

move_files:
    [mkdir] Created dir: /tmp/test/build/builds
     [move] Deleting directory /tmp/test/build/builds
     [move] Deleting directory /tmp/test/build

BUILD SUCCESSFUL
Total time: 2 seconds
surendrn@dedapp4 bash$ 

surendrn@dedapp4 bash$ ls -l test/build/
total 16
-rwxr-xr-x   1 surendrn staff        458 Apr  9 22:53 test.xml
surendrn@dedapp4 bash$ ant -v -f test.xml -DTEST.ROOT.DIR=/tmp/test 
Apache Ant version 1.5.3 compiled on April 9 2003
Buildfile: test.xml
Detected Java version: 1.3 in: /vgp/shared/jdk/j2sdk1_3_1_04/jre
Detected OS: SunOS
parsing buildfile test.xml with URI = file:/tmp/test.xml
Project base dir set to: /tmp
Build sequence for target `move_files' is [move_files]
Complete build sequence is [move_files]

move_files:
    [mkdir] Created dir: /tmp/test/build/builds

BUILD SUCCESSFUL
Total time: 2 seconds
surendrn@dedapp4 bash$

Mime
View raw message