[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: test through java



On Thu, Jul 27, 2000 at 08:41:56PM +0530, Chetan Gopal Kashinath wrote:
> hi all,
> 
>     i want to execute " test -d <some directory> " through my java file....
> is it possible ?? how do i do it ??

If you have to absolutely run on the java vm, try out jpython. I would
do:

$ jpython
JPython 1.1 on java1.2.2-RC2 (JIT: javacomp)
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> import sys
>>> sys.add_package('java.io')
<java package java.io at 893753335>
>>> from java.io import File
>>> d = File('/etc')
>>> print d.exists()
1
>>> d = File('/vacuum')
>>> print d.exists()
0
>>> 

	-Arun