🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17168

Re: System commands

#17168
From: Vasudevan Srinivasan
Date: Tue, 08 Dec 1998 00:00
28 lines
1735 bytes
Hi,
I need to use renaming/copying commands, coz my source filename and target
file name are same ! So im using the usual technique, writing to a new file
and renaming it as old file.
afa spawning a process, i found a Runtime.exec() method, but my goal is to
run the javac compiler to compile a java file, from the application itself.
i tried it a couple of times and both the times my ide crashed. is it
possible ? any ideas. im also working at it and wll let know. meanwhile, if
anybody had done similar things successfully pls share.

Thanks

William Yu wrote:

> Vasudevan Srinivasan wrote:
>
> > How do I run system commands like renaming/copying/deleting a file or
>
> java.io.File has most of what you need.  There isn't a copy method but
> you can implement it by using InputStream to read from a file and
> OutputStream to write to a new file.
>
> > spawn a process from inside a java application ?
>
> Threads will do what you want.  Except you can't think of them in the
> same way as fork.  I would suggest reading up on this subject very
> carefully as my experience says Threads are needed in any non-trivial
> Java application.
Technical Details
Message-ID: <366D3DF0.D0219DD6@netrisk.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <366C299A.D3B214C@netrisk.com> <366CDEC4.F10E39E3@Bigfoot.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,7082a9d3587f7529
X-Google-Attributes: gidf74b3,public
From: Vasudevan Srinivasan <vasudevan@netrisk.com>
Subject: Re: System commands
Date: 1998/12/08
Message-ID: <366D3DF0.D0219DD6@netrisk.com>
X-Deja-AN: 420065214
Content-Transfer-Encoding: 7bit
References: <366C299A.D3B214C@netrisk.com> <366CDEC4.F10E39E3@Bigfoot.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language