[Advanced-java] Java apps and doing OS stuff

Nikolaos Giannopoulos nikolaos at solmar.ca
Fri Jul 11 21:13:40 2003


> -----Original Message-----
> From: Thomas Nichols [mailto:nx10mail@yahoo.co.uk]
> Sent: Friday, July 11, 2003 3:32 PM
>
> >We use bourne shell scripts (on Linux and Solaris) to do things like:
> >
> >+ pre-process commands and launch our java app
> >   --> e.g. user can simply type:  ./seahorse start
> >
> >+ OS specific pre|post-installation during installs and upgrades
> >   --> recursive copying a directory + retaining permissions, etc....
>
> If all you want is a better scripting environment for Windows, there are
> several Unix-clone options (such as Cygwin or MKS); these will add the
> functionality you're currently missing  and allow you to run bash scripts
> under Windows.

This option although ideal won't work as we won't have control over the
target system i.e. in addition any solution will require that I be able to
re-distribute it in a rather feasible manner.


> Alternatively you could go for an enhanced Windows command processor such
> as 4NT from jpsoft.

I'll look into this although as I'm seeing it now it would be nice to get
rid of the dos and unix scripting altogether and have a cross-platform
solution.


> If you want a Java-based solution, perhaps Jython or JudoScript.

Can these languages allow you to issue OS commands and tests on the
filesystem such as:  recursive directory copy (keeping permissions),
conditional processing on exit result of an app, conditional processing on
existence of a dir, etc....

One of the reasons the install/upgrade scripts are not 100% java is because
java does not retain permissions during file copy - do these languages get
me any further along in this respect?  I'm guessing no from what I had
previously read on Jython.


> There are
> currently 165 languages for the Java VM listed at
> http://grunge.cs.tu-berlin.de/~tolk/vmlanguages.html
> These include scripting languages like JavaScript/Rhino and JRuby,
> "scripting frameworks" like Bean Scripting Framework and
> implementations of
> many other languages such as Prolog, Ada and even  (if you're feeling
> nostalgic) COBOL.

Okay.  But I'm not looking for an alternative to Java.  I'm looking for
something that will plug holes that Java currently has -

Which of these scripting languages would be best in manipulating the file
system, is compact, re-distributable (with a commercial product) and is
cross platform?

Thanks,

--Nikolaos