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 22632] - Delete follows symbolic links to directories
Date Fri, 22 Aug 2003 18:39:39 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=22632>.
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=22632

Delete follows symbolic links to directories

brian.compton@wmg.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |



------- Additional Comments From brian.compton@wmg.com  2003-08-22 18:39 -------
Sorry to have to reopen this again, but your solution does not work if what you 
are trying to do is delete a directory. Yes, the directory pointed to by the 
symbolic link was not touched which is great. But, the symbolic link was not 
deleted either. So, if I had wanted to delete the "alpha" directory completely, 
I cannot. 

Here is a script I have been testing with along with the output:

<project name="deltest" default="delete">
  <target name="delete">
    <exec executable='ls' os='UNIX:Linux:SunOS'>
      <arg value="-alR"/>
    </exec>
    <mkdir dir="xx/yy"/>
    <touch file="xx/yy/f1"/>
    <touch file="xx/yy/f2"/>
    <mkdir dir="aa"/>
    <touch file="aa/f3"/>
    <touch file="aa/f4"/>
    <exec executable='ln' os='UNIX:Linux:SunOS'>
      <arg value='-s'/>
      <arg path='aa'/>
      <arg path='xx/yy/zz'/>
    </exec>
    <exec executable='ls' os='UNIX:Linux:SunOS'>
      <arg value="-alR"/>
    </exec>
    <delete verbose="true" includeEmptyDirs="true">
      <fileset dir="xx" followsymlinks="false">
        <include name="yy/**"/>
      </fileset>
    </delete>
    <exec executable='ls' os='UNIX:Linux:SunOS'>
      <arg value="-alR"/>
    </exec>
  </target>
</project>

===================================================================

Buildfile: build.xml

delete:
     [exec] .:
     [exec] total 6
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:33 .
     [exec] drwxr-xr-x   6 dynamo6  dynamo6      512 Aug 22 11:25 ..
     [exec] -rw-r--r--   1 dynamo6  dynamo6      811 Aug 22 11:34 build.xml
    [mkdir] Created dir: /export/home/dynamo6/tmp/test2/xx/yy
    [touch] Creating /export/home/dynamo6/tmp/test2/xx/yy/f1
    [touch] Creating /export/home/dynamo6/tmp/test2/xx/yy/f2
    [mkdir] Created dir: /export/home/dynamo6/tmp/test2/aa
    [touch] Creating /export/home/dynamo6/tmp/test2/aa/f3
    [touch] Creating /export/home/dynamo6/tmp/test2/aa/f4
     [exec] .:
     [exec] total 10
     [exec] drwxr-xr-x   4 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   6 dynamo6  dynamo6      512 Aug 22 11:25 ..
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 aa
     [exec] -rw-r--r--   1 dynamo6  dynamo6      811 Aug 22 11:34 build.xml
     [exec] drwxr-xr-x   3 dynamo6  dynamo6      512 Aug 22 11:34 xx

     [exec] ./aa:
     [exec] total 4
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   4 dynamo6  dynamo6      512 Aug 22 11:34 ..
     [exec] -rw-r--r--   1 dynamo6  dynamo6        0 Aug 22 11:34 f3
     [exec] -rw-r--r--   1 dynamo6  dynamo6        0 Aug 22 11:34 f4

     [exec] ./xx:
     [exec] total 6
     [exec] drwxr-xr-x   3 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   4 dynamo6  dynamo6      512 Aug 22 11:34 ..
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 yy

     [exec] ./xx/yy:
     [exec] total 6
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   3 dynamo6  dynamo6      512 Aug 22 11:34 ..
     [exec] -rw-r--r--   1 dynamo6  dynamo6        0 Aug 22 11:34 f1
     [exec] -rw-r--r--   1 dynamo6  dynamo6        0 Aug 22 11:34 f2
     [exec] lrwxrwxrwx   1 dynamo6  dynamo6       33 Aug 22 11:34 zz -
> /export/home/dynamo6/tmp/test2/aa
   [delete] Deleting 2 files from /export/home/dynamo6/tmp/test2/xx
   [delete] Deleting /export/home/dynamo6/tmp/test2/xx/yy/f1
   [delete] Deleting /export/home/dynamo6/tmp/test2/xx/yy/f2
     [exec] .:
     [exec] total 10
     [exec] drwxr-xr-x   4 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   6 dynamo6  dynamo6      512 Aug 22 11:25 ..
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 aa
     [exec] -rw-r--r--   1 dynamo6  dynamo6      811 Aug 22 11:34 build.xml
     [exec] drwxr-xr-x   3 dynamo6  dynamo6      512 Aug 22 11:34 xx

     [exec] ./aa:
     [exec] total 4
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   4 dynamo6  dynamo6      512 Aug 22 11:34 ..
     [exec] -rw-r--r--   1 dynamo6  dynamo6        0 Aug 22 11:34 f3
     [exec] -rw-r--r--   1 dynamo6  dynamo6        0 Aug 22 11:34 f4

     [exec] ./xx:
     [exec] total 6
     [exec] drwxr-xr-x   3 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   4 dynamo6  dynamo6      512 Aug 22 11:34 ..
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 yy

     [exec] ./xx/yy:
     [exec] total 6
     [exec] drwxr-xr-x   2 dynamo6  dynamo6      512 Aug 22 11:34 .
     [exec] drwxr-xr-x   3 dynamo6  dynamo6      512 Aug 22 11:34 ..
     [exec] lrwxrwxrwx   1 dynamo6  dynamo6       33 Aug 22 11:34 zz -
> /export/home/dynamo6/tmp/test2/aa

BUILD SUCCESSFUL
Total time: 3 seconds

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


Mime
View raw message