Java on linux question

Eric Richardson eric@milagrosoft.com
Wed, 07 Mar 2001 09:26:26 -0700


Joel Dudley wrote:
> 
> Our company is currently migrating our technology from NT/Novell to Linux.
> Recently, a developer approached me with a java on linux question that I
> could not answer. He was writing a java app that will run in a JVM on linux
> and access the linux file system using java IO. Now we dont want anything
> like that running as root so what is the best way for java io to interact
> with user/group permissions on the file system? Apperently when this app was
> on novell he was able to use a novell user class. Thanks for reading my
> post.
If you are using Java 2 then everything you need to access the file
system in a normal safe way is in java.io.File. There are some things
that can't be done but the user/group that starts the java VM is
effective from a code point of view.

You can rename, remove, set readOnly, create files and dirs, look at
update times etc. Refer to the java doc for more info. The second link
is the javadoc for File and the first is the main jdk1.2 doc page.

http://java.sun.com/products/jdk/1.2/docs/index.html
http://java.sun.com/products/jdk/1.2/docs/api/java/io/File.html

If you have other more difficult requirements, I may have pointers as
well.
Eric :-)