I will use one of these
thanks,
manoj
-----Original Message-----
From: peter reilly [mailto:peter.reilly@corvil.com]
Sent: Wednesday, June 04, 2003 10:39 AM
To: Ant Users List
Subject: Re: Problem with deleting a file inside javascript
looks like "delete" is a keyword in javascript (or rhino)
use jython/jpython or beanshell
<script language="javascript"> <![CDATA[
importClass(java.io.File);
f = File("test.txt");
fsize = f.length();
if(fsize <= 15)
{
f.canRead(); // delete does not work here
}
]]> </script>
<script language="beanshell"> <![CDATA[
import java.io.File;
f = new File("test.txt");
fsize = f.length();
if(fsize <= 15)
{
f.delete();
}
]]> </script>
<script language="jython"> <![CDATA[
from java.io import File
f = File("test.txt");
fsize = f.length();
if fsize <= 15:
f.delete();
]]> </script>
Peter
On Wednesday 04 June 2003 15:02, Manoj Sadangi wrote:
> How can I delete a file inside javascript?
> This is throwing error in the line f.delete() "missing name after .
> operator"
> <script language="javascript"> <![CDATA[
> importClass(java.io.File);
> f = File("test.txt");
> fsize = f.length();
> if(fsize <= 15)
> {
> f.delete();
> }
> ]]> </script>
>
> thanks,
> manoj
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|