• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delete a directory in unix box using ant

 
Devi Sri
Ranch Hand
Posts: 115
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Please help me.

How to delete a directory from a unix box by using ant?

Could you please suggest me ?

Thanks in advance.
[ August 13, 2008: Message edited by: Devisri Nanubala ]
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant has the Delete task which can be used for doing this.
 
Devi Sri
Ranch Hand
Posts: 115
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jaikiran,

But that delete task is not working for my process.
As my unix box is on remote machine connected through ssh.

And I need to delete a directory in that remote unix box, through my local machine ant build.
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Devisri Nanubala:
... As my unix box is on remote machine connected through ssh.

And I need to delete a directory in that remote unix box, through my local machine ant build.


You can execute commands on the remote box using the ant SSHEXEC optional task.

The unix command to unconditionaly remove a directory, even if it is not empty, is
(take care, danger!)

rm -fr dirname
[ August 13, 2008: Message edited by: Jan Cumps ]
 
Devi Sri
Ranch Hand
Posts: 115
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jan,

Thankyou. It's working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic