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

Re: test through java

----- Original Message -----
From: deepak yadav <deepak2000@xxxxxxxxxxxx>
Subject: Re: [LIP] test through java

> import java.io.*;
> class test
> {
> public static void main(String[] args)
> {
>                 File f ;
>                 f = new File("c:/windows/win.ini");
> if (f.isDirectory())
> System.out.println("It is a dir");
> else
> System.out.println("It is not a dir");
> }
> }
hi deepak,

    thanks for ur reply... it worked just the way i wanted...

uday and anil,

    i had tried Process and runtime b4 posting on the list and it hadn't
worked :-( the documentation says runtime.exec() may not run properly in
certain cases including shell scripts on unix :-( that is the only
explaination i could think of for it not to work )

new problem:

    due to the same reason ( i think ) i am unable to do a real u-id check
for my process through my java code. the different approaches are:

1. echo $LOGNAME will check the real u-id but wont work with runtime.exec()
2. getuid() can't be used ( afaik ) in my java code

    basically i want to get the user name of the real u-id of the process
when somebody runs my java class file... how can it be done ??? ( i would
have set the 's' bit of my class file )

thank you
- chetu