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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


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>


[EMAIL PROTECTED] bash$ ls -l test/build/
total 0
[EMAIL PROTECTED] 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
[EMAIL PROTECTED] bash$ 

[EMAIL PROTECTED] bash$ ls -l test/build/
total 16
-rwxr-xr-x   1 surendrn staff        458 Apr  9 22:53 test.xml
[EMAIL PROTECTED] 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
[EMAIL PROTECTED] bash$

Reply via email to