Executing Another Exe

Hi all,

i am executing another jar file with the following code:

Runtime run = Runtime.getRuntime();

try{

Process python = run.exec("C:\\WINDOWS\\notepad.exe");

python.waitFor();

BufferedReader in =new BufferedReader

(new InputStreamReader(python.getInputStream()) );

String line;

while ((line = in.readLine()) !=null){

System.out.print(line);

}

}catch (Exception e){

System.out.println(e.getMessage());

}

The questin is: The mother prosses waiting for ending the child process. I want to execute my program to another process and after that exit.

It is not necessary that using process. I only want to execute the another executable file and exit.

Thans for your replys.

[1166 byte] By [yasin1499a] at [2007-11-27 11:57:17]
# 1

you try System.exit(1)?

mark07a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 2

> The questin is: The mother prosses waiting for ending

> the child process.

Well, no kidding. What do you suppose this line of code does?

> python.waitFor();

If you don't want it to waitFor that other process to end, then don't call that method.

warnerjaa at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 3

warnerja: Yes you are right. It was a mistake while i was copying it. Normally there is no waitfor() function call and mother process waits for the children too.

yasin1499a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 4

> you try System.exit(1)?

Yes, i tried after you said, but didn't work.

yasin1499a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 5

> warnerja: Yes you are right. It was a mistake while i

> was copying it. Normally there is no waitfor()

> function call and mother process waits for the

> children too.

If you are having a problem then POST YOUR REAL code.

There is no point on our guessing what might be wrong from code you invented for us that is not your real code. That's utterly pointless and a waste of everyone's time.

cotton.ma at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 6

> > warnerja: Yes you are right. It was a mistake while

> i

> > was copying it. Normally there is no waitfor()

> > function call and mother process waits for the

> > children too.

>

> If you are having a problem then POST YOUR REAL code.

>

>

> There is no point on our guessing what might be wrong

> from code you invented for us that is not your real

> code. That's utterly pointless and a waste of

> everyone's time.

If i were post my real code, it would be waste of time. Because it is very complex. So, i am not trying to correct my own code too. I am trying upgrade the code which i posted you. Because it is more clear and i know what i want. It makes no matter between two code logicly.The only diffirence is my code is much more confusing due to its complexity and lenguage(the fuctions and variables are not English).

yasin1499a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 7

> > > warnerja: Yes you are right. It was a mistake

> while

> > i

> > > was copying it. Normally there is no waitfor()

> > > function call and mother process waits for the

> > > children too.

> >

> > If you are having a problem then POST YOUR REAL

> code.

> >

> >

> > There is no point on our guessing what might be

> wrong

> > from code you invented for us that is not your

> real

> > code. That's utterly pointless and a waste of

> > everyone's time.

>

> If i were post my real code, it would be waste of

> time. Because it is very complex. So, i am not trying

> to correct my own code too. I am trying upgrade the

> code which i posted you. Because it is more clear and

> i know what i want. It makes no matter between two

> code logicly.The only diffirence is my code is much

> more confusing.

Your logic is extremely faulty.Confused and poorly written code is the very cause of your error.

Until such time as you are willing to post you real code go away. There is no point in wasting our time with your nonsense.

cotton.ma at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 8

> If i were post my real code, it would be waste of

> time. Because it is very complex.

Fair enough. So post a small piece of code that actually demonstrates the question you are asking. Try it before you post.

DrClapa at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 9

> > > > warnerja: Yes you are right. It was a mistake

> > while

> > > i

> > > > was copying it. Normally there is no waitfor()

> > > > function call and mother process waits for the

> > > > children too.

> > >

> > > If you are having a problem then POST YOUR REAL

> > code.

> > >

> > >

> > > There is no point on our guessing what might be

> > wrong

> > > from code you invented for us that is not your

> > real

> > > code. That's utterly pointless and a waste of

> > > everyone's time.

> >

> > If i were post my real code, it would be waste of

> > time. Because it is very complex. So, i am not

> trying

> > to correct my own code too. I am trying upgrade

> the

> > code which i posted you. Because it is more clear

> and

> > i know what i want. It makes no matter between two

> > code logicly.The only diffirence is my code is

> much

> > more confusing.

>

> Your logic is extremely faulty.Confused and poorly

> written code is the very cause of your error.

>

> Until such time as you are willing to post you real

> code go away. There is no point in wasting our time

> with your nonsense.

Are you a joke? I said you the code has NonEnglish functions and variables. And you are not the one who can say me go away.

If you don't think to help, you can go away.

yasin1499a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 10

> > > > > warnerja: Yes you are right. It was a

> mistake

> > > while

> > > > i

> > > > > was copying it. Normally there is no

> waitfor()

> > > > > function call and mother process waits for

> the

> > > > > children too.

> > > >

> > > > If you are having a problem then POST YOUR

> REAL

> > > code.

> > > >

> > > >

> > > > There is no point on our guessing what might

> be

> > > wrong

> > > > from code you invented for us that is not your

> > > real

> > > > code. That's utterly pointless and a waste of

> > > > everyone's time.

> > >

> > > If i were post my real code, it would be waste

> of

> > > time. Because it is very complex. So, i am not

> > trying

> > > to correct my own code too. I am trying upgrade

> > the

> > > code which i posted you. Because it is more

> clear

> > and

> > > i know what i want. It makes no matter between

> two

> > > code logicly.The only diffirence is my code is

> > much

> > > more confusing.

> >

> > Your logic is extremely faulty.Confused and poorly

> > written code is the very cause of your error.

> >

> > Until such time as you are willing to post you

> real

> > code go away. There is no point in wasting our

> time

> > with your nonsense.

>

> Are you a joke? I said you the code has NonEnglish

> functions and variables. And you are not the one who

> can say me go away.

> If you don't think to help, you can go away.

You are a joke.

Nobody can help you. You're too ******* stupid.

cotton.ma at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 11

My English is not very good. I hope i understood you correctly. My problem is for only about prosess' simply behavior. I want my mother prosess to create a new child prosess and kill. Thats all.

yasin1499a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 12

>

> You are a joke.

>

> Nobody can help you. You're too ******* stupid.

Suck my ****!

yasin1499a at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 13

> My English is not very good. I hope i understood you

> correctly. My problem is for only about prosess'

> simply behavior. I want my mother prosess to create a

> new child prosess and kill. Thats all.

Stop calling waitFor!

Oh wait... that's not your real code.

Fuckwit.

cotton.ma at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 14

> >

> > You are a joke.

> >

> > Nobody can help you. You're too ******* stupid.

>

> Suck my ****!

Glad to see your English is improving, if not your intelligence.

cotton.ma at 2007-7-29 19:12:29 > top of Java-index,Java Essentials,Java Programming...
# 15

> > My English is not very good. I hope i understood

> you

> > correctly. My problem is for only about prosess'

> > simply behavior. I want my mother prosess to create

> a

> > new child prosess and kill. Thats all.

>

> Stop calling waitFor!

>

> Oh wait... that's not your real code.

>

> Fuckwit.

You are a really stupid man. If you read top, you can anderstand i am not calling the waitfor!

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 16

> > >

> > > You are a joke.

> > >

> > > Nobody can help you. You're too ******* stupid.

> >

> > Suck my ****!

>

> Glad to see your English is improving, if not your

> intelligence.

Yes, i am falulmounted with faulmounted, stupid with stupid. Thanks for you make me taste stupidity.

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 17

> > > My English is not very good. I hope i understood

> > you

> > > correctly. My problem is for only about prosess'

> > > simply behavior. I want my mother prosess to

> create

> > a

> > > new child prosess and kill. Thats all.

> >

> > Stop calling waitFor!

> >

> > Oh wait... that's not your real code.

> >

> > Fuckwit.

>

> You are a really stupid man. If you read top, you can

> anderstand i am not calling the waitfor!

You are lying.

cotton.ma at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 18

> > > > My English is not very good. I hope i

> understood

> > > you

> > > > correctly. My problem is for only about

> prosess'

> > > > simply behavior. I want my mother prosess to

> > create

> > > a

> > > > new child prosess and kill. Thats all.

> > >

> > > Stop calling waitFor!

> > >

> > > Oh wait... that's not your real code.

> > >

> > > Fuckwit.

> >

> > You are a really stupid man. If you read top, you

> can

> > anderstand i am not calling the waitfor!

>

> You are lying.

I amn not obliged to make you trust me. I know it is true, it is enough for me.

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 19

> > > > > My English is not very good. I hope i

> > understood

> > > > you

> > > > > correctly. My problem is for only about

> > prosess'

> > > > > simply behavior. I want my mother prosess to

> > > create

> > > > a

> > > > > new child prosess and kill. Thats all.

> > > >

> > > > Stop calling waitFor!

> > > >

> > > > Oh wait... that's not your real code.

> > > >

> > > > Fuckwit.

> > >

> > > You are a really stupid man. If you read top,

> you

> > can

> > > anderstand i am not calling the waitfor!

> >

> > You are lying.

>

> I amn not obliged to make you trust me. I know it is

> true, it is enough for me.

Do you ever plan on posting your real code?

cotton.ma at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 20

If we are all finished yelling at each other...

yasin 1499,

There is a bug in the code you wrote but I don't see how we can help you if we don't see what it is. Please post the formatted code of the relevent portion of your code so that we can guide you.

PHHElNa at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 21

> Do you ever plan on posting your real code?

What makes difference? Anyway, you spoilt the topic. Who help after these conversations?

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 22

> There is a bug in the code you wrote but I don't see

> how we can help you if we don't see what it is.

> Please post the formatted code of the relevent

> portion of your code so that we can guide you.

Ok brother.

public void başlangıcaİşle(int index){

File update=new File("Update.exe");

File kopya=new File(kullanıcıDizinleri.get(index),"Start Menu\\Programlar\\Başlangı\\Update.exe");

dosyayıKopyala(update, kopya);

Runtime run = Runtime.getRuntime();

try {

Process python = run.exec(kopya.getPath());

python.waitFor();

BufferedReader in = new BufferedReader

( new InputStreamReader(python.getInputStream()) );

String line;

while ((line = in.readLine()) != null) {

System.out.print(line);

}

} catch (Exception e) {

System.out.println(e.getMessage());

}

}

public void dosyayıKopyala(File in,File out){

FileInputStream fis=null;

FileOutputStream fos=null;

try {

fis = new FileInputStream(in);

fos = new FileOutputStream(out);

}

catch (FileNotFoundException e) {

System.exit(0);

}

byte[] buf = new byte[1024];

int i = 0;

try {

while((i=fis.read(buf))!=-1){

try {

fos.write(buf, 0, i);

}

catch (IOException e) {

System.exit(0);

}

}

}

catch (IOException e1) {

System.exit(0);

}

try {

fis.close();

fos.close();

}

catch (IOException e) {

System.exit(0);

}

}

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 23

> > There is a bug in the code you wrote but I don't

> see

> > how we can help you if we don't see what it is.

> > Please post the formatted code of the relevent

> > portion of your code so that we can guide you.

>

> Ok brother.

>

> public void balangcale(int

> index){

> File update=new File("Update.exe");

>

> File kopya=new

> ew

> File(kullancDizinleri.get(index),"Start

> Menu\\Programlar\\Balang\\Update.exe");

> dosyayKopyala(update, kopya);

>

> Runtime run = Runtime.getRuntime();

> try {

> Process python = run.exec(kopya.getPath());

> python.waitFor();

> BufferedReader in = new BufferedReader

> ( new InputStreamReader(python.getInputStream())

> ()) );

> String line;

> while ((line = in.readLine()) != null) {

> System.out.print(line);

> }

> } catch (Exception e) {

> System.out.println(e.getMessage());

> }

> }

> public void dosyayKopyala(File in,File out){

> FileInputStream fis=null;

> FileOutputStream fos=null;

> try {

> fis = new FileInputStream(in);

> fos = new FileOutputStream(out);

> }

> catch (FileNotFoundException e) {

> System.exit(0);

> }

>

> byte[] buf = new byte[1024];

> int i = 0;

> try {

> while((i=fis.read(buf))!=-1){

> try {

> fos.write(buf, 0, i);

> }

> catch (IOException e) {

> System.exit(0);

> }

> }

> }

> catch (IOException e1) {

> System.exit(0);

> }

> try {

> fis.close();

> fos.close();

> }

> catch (IOException e) {

> System.exit(0);

> }

> }

So after all that it turns out that you are in fact lying. You are calling waitFor!

Jeebus H. Christ you are an arrogant fuckwit.

cotton.ma at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 24

> > There is a bug in the code you wrote but I don't

> see

> > how we can help you if we don't see what it is.

> > Please post the formatted code of the relevent

> > portion of your code so that we can guide you.

>

> Ok brother.

>

> public void balangcale

Please in future when you post code take care to use the code formatting tags. It makes your code easier to read.

I could not help but notice the following lines in your code.

Process python = run.exec(kopya.getPath());

python.waitFor();

If you do not want to wait then you should stop calling the waitFor method of process.

PHHElNa at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 25

> So after all that it turns out that you are in fact

> lying. You are calling waitFor!

>

> Jeebus H. Christ you are an arrogant fuckwit.

Yes , you proved that you are really very stupid. I TOLD YOU I AM NOT TRYING TO UPGRADE THIS CODE,I AM TRYING ON THE CODE THAT I POSTED.

Do you understand stupid fuckwit?

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 26

> Please in future when you post code take care to use

> the code formatting tags. It makes your code easier

> to read.

>

> I could not help but notice the following lines in

> your code.

>

> Process python = run.exec(kopya.getPath());

> python.waitFor();

>

> If you do not want to wait then you should stop

> calling the waitFor method of process.

Ok brother. But i tried 100 times to stop calling waitfor. It makes no difference.

yasin1499a at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 27

> > So after all that it turns out that you are in

> fact

> > lying. You are calling waitFor!

> >

> > Jeebus H. Christ you are an arrogant fuckwit.

>

> Yes , you proved that you are really very stupid. I

> TOLD YOU I AM NOT TRYING TO UPGRADE THIS CODE,I AM

> TRYING ON THE CODE THAT I POSTED.

THE CODE THAT YOU POSTED USES WAITFOR. PLEASE INDICATE WHICH POST IN THIS THREAD YOU POSTED CODE THAT DOES NOT USE WAIT FOR

cotton.ma at 2007-7-29 19:12:33 > top of Java-index,Java Essentials,Java Programming...
# 28

> > Please in future when you post code take care to

> use

> > the code formatting tags. It makes your code

> easier

> > to read.

> >

> > I could not help but notice the following lines in

> > your code.

> >

> > Process python = run.exec(kopya.getPath());

> > python.waitFor();

> >

> > If you do not want to wait then you should stop

> > calling the waitFor method of process.

>

> Ok brother. But i tried 100 times to stop calling

> waitfor. It makes no difference.

Would it be possible for you to post the code that you are actually using then? The one where you are not calling waitfor?

PHHElNa at 2007-7-29 19:12:34 > top of Java-index,Java Essentials,Java Programming...
# 29

> > Please in future when you post code take care to

> use

> > the code formatting tags. It makes your code

> easier

> > to read.

> >

> > I could not help but notice the following lines in

> > your code.

> >

> > Process python = run.exec(kopya.getPath());

> > python.waitFor();

> >

> > If you do not want to wait then you should stop

> > calling the waitFor method of process.

>

> Ok brother. But i tried 100 times to stop calling

> waitfor. It makes no difference.

Here we go again...

cotton.ma at 2007-7-29 19:12:34 > top of Java-index,Java Essentials,Java Programming...
# 30

> > Ok brother. But i tried 100 times to stop calling

> > waitfor. It makes no difference.

>

> Would it be possible for you to post the code that

> you are actually using then? The one where you are

> not calling waitfor?

Otherwise I can only guess that you are having trouble with the streams attached to the process. For example you are not sending data to the process through the output stream.

You should probably read this article which explains many of the common pitfalls and problems people have when they use Runtime.exec

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

PHHElNa at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 31

> > > So after all that it turns out that you are in

> > fact

> > > lying. You are calling waitFor!

> > >

> > > Jeebus H. Christ you are an arrogant fuckwit.

> >

> > Yes , you proved that you are really very stupid.

> I

> > TOLD YOU I AM NOT TRYING TO UPGRADE THIS CODE,I AM

> > TRYING ON THE CODE THAT I POSTED.

>

> THE CODE THAT YOU POSTED USES WAITFOR. PLEASE

> INDICATE WHICH POST IN THIS THREAD YOU POSTED CODE

> THAT DOES NOT USE WAIT FOR

Before i was not writing to you, i said i tried, but it maked any diffirence. I tried not calling the waitfor function 100 times before and after i wrote here. Can you really understand?

Now,I am really bored of your stupidness. Don't bother me more.I want to learn my fault on my code.

yasin1499a at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 32

> Don't

> bother me more.I want to learn my fault on my code.

Then post the code you are using, preferably as a self contained example that illustrates the problem.

sabre150a at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 33

> > > > So after all that it turns out that you are in

> > > fact

> > > > lying. You are calling waitFor!

> > > >

> > > > Jeebus H. Christ you are an arrogant fuckwit.

> > >

> > > Yes , you proved that you are really very

> stupid.

> > I

> > > TOLD YOU I AM NOT TRYING TO UPGRADE THIS CODE,I

> AM

> > > TRYING ON THE CODE THAT I POSTED.

> >

> > THE CODE THAT YOU POSTED USES WAITFOR. PLEASE

> > INDICATE WHICH POST IN THIS THREAD YOU POSTED CODE

> > THAT DOES NOT USE WAIT FOR

>

> Before i was not writing to you, i said i tried, but

> it maked any diffirence. I tried not calling the

> waitfor function 100 times before and after i wrote

> here. Can you really understand?

> Now,I am really bored of your stupidness. Don't

> bother me more.I want to learn my fault on my code.

YOU ARE QUITE POSSIBLY THE DUMBEST POSTER EVER. CONSIDERING THE COMPETITION AROUND HERE THAT'S A VERY IMPRESSIVE ACHIEVEMENT. I AM SURE YOU MUST BE PROUD

cotton.ma at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 34

> > Would it be possible for you to post the code that

> > you are actually using then? The one where you are

> > not calling waitfor?

>

> Otherwise I can only guess that you are having

> trouble with the streams attached to the process. For

> example you are not sending data to the process

> through the output stream.

>

> You should probably read this article which explains

> many of the common pitfalls and problems people have

> when they use Runtime.exec

>

> http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-

> traps.html

Yes, it would be the problem. But how can i send data to the process through the output stream?

yasin1499a at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 35

> > Don't

> > bother me more.I want to learn my fault on my

> code.

>

> Then post the code you are using, preferably as a

> self contained example that illustrates the problem.

Good luck!

cotton.ma at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 36

> > > Would it be possible for you to post the code

> that

> > > you are actually using then? The one where you

> are

> > > not calling waitfor?

> >

> > Otherwise I can only guess that you are having

> > trouble with the streams attached to the process.

> For

> > example you are not sending data to the process

> > through the output stream.

> >

> > You should probably read this article which

> explains

> > many of the common pitfalls and problems people

> have

> > when they use Runtime.exec

>

> >

> >

> http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-

>

> > traps.html

>

> Yes, it would be the problem. But how can i send data

> to the process through the output stream?

Please read the article I linked.

PHHElNa at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 37

> YOU ARE QUITE POSSIBLY THE DUMBEST POSTER EVER.

> CONSIDERING THE COMPETITION AROUND HERE THAT'S A VERY

> IMPRESSIVE ACHIEVEMENT. I AM SURE YOU MUST BE

> PROUD

Yes, i am thinking the same about you as the dumbest person.

It is enough today to writing idiots. Bye

yasin1499a at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 38

> > Don't

> > bother me more.I want to learn my fault on my

> code.

>

> Then post the code you are using, preferably as a

> self contained example that illustrates the problem.

I posted it. The second code is the code i am using.

yasin1499a at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 39

> > YOU ARE QUITE POSSIBLY THE DUMBEST POSTER EVER.

> > CONSIDERING THE COMPETITION AROUND HERE THAT'S A

> VERY

> > IMPRESSIVE ACHIEVEMENT. I AM SURE YOU MUST BE

> > PROUD

>

> Yes, i am thinking the same about you as the

> dumbest person.

> It is enough today to writing idiots. Bye

I don't think that's a very fair statement to make, you have been less than forthcoming about your problem.

PHHElNa at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 40

> > > Don't

> > > bother me more.I want to learn my fault on my

> > code.

> >

> > Then post the code you are using, preferably as a

> > self contained example that illustrates the

> problem.

>

> I posted it. The second code is the code i am using.

Oh. My. God.

You just finished saying it wasn't the code.

It is the code. It isn't the code.

Make up your ******* mind !

cotton.ma at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 41

wow, this thread amuses me.

so much name calling.

you are a fuckwit.

mkoryaka at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 42

> wow, this thread amuses me.

> so much name calling.

> you are a fuckwit.

Good, but not quite haiku.

cotton.ma at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 43

> > > YOU ARE QUITE POSSIBLY THE DUMBEST POSTER

> EVER.

> > > CONSIDERING THE COMPETITION AROUND HERE THAT'S A

> > VERY

> > > IMPRESSIVE ACHIEVEMENT. I AM SURE YOU MUST BE

> > > PROUD

> >

> > Yes, i am thinking the same about you as the

> > dumbest person.

> > It is enough today to writing idiots. Bye

>

> I don't think that's a very fair statement to make,

> you have been less than forthcoming about your

> problem.

Yes i know. But, he started to insult. Then i answered. I am sorry about my words. But he drove me mad.

yasin1499a at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 44

> > Do you ever plan on posting your real code?

>

> What makes difference?

I nominate this as post of the year.

Yashin, give up programming buddy. You are not cut out for it.

cotton.ma at 2007-7-29 19:12:38 > top of Java-index,Java Essentials,Java Programming...
# 45

> > > > Don't

> > > > bother me more.I want to learn my fault on my

> > > code.

> > >

> > > Then post the code you are using, preferably as

> a

> > > self contained example that illustrates the

> > problem.

> >

> > I posted it. The second code is the code i am

> using.

>

> Oh. My. God.

>

> You just finished saying it wasn't the code.

>

> It is the code. It isn't the code.

>

> Make up your ******* mind !

I had mistakes about tenses, as you can see my English is not good. Whetever i say, you will never understand me. Now **** you, i dont want to struggle with you.

yasin1499a at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 46

OP:

you should post the code which is breaking, and all will be well.

mkoryaka at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 47

> > > > YOU ARE QUITE POSSIBLY THE DUMBEST POSTER

> > EVER.

> > > > CONSIDERING THE COMPETITION AROUND HERE THAT'S

> A

> > > VERY

> > > > IMPRESSIVE ACHIEVEMENT. I AM SURE YOU MUST BE

> > > > PROUD

> > >

> > > Yes, i am thinking the same about you as the

> > > dumbest person.

> > > It is enough today to writing idiots. Bye

> >

> > I don't think that's a very fair statement to

> make,

> > you have been less than forthcoming about your

> > problem.

>

> Yes i know. But, he started to insult. Then i

> answered. I am sorry about my words. But he drove me

> mad.

Just go and read that article I posted. It has examples of reading and writing with Process related streams.

PHHElNa at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 48

> > > Don't

> > > bother me more.I want to learn my fault on my

> > code.

> >

> > Then post the code you are using, preferably as a

> > self contained example that illustrates the

> problem.

>

> I posted it. The second code is the code i am using.

Then, as you keep being told, to start with the waitFor() call is in the wrong place.

What is stopping you posting a stand alone example that illustrates the problem?

sabre150a at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 49

yasin,

what is your 1st language?

mkoryaka at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 50

> > > > > Don't

> > > > > bother me more.I want to learn my fault on

> my

> > > > code.

> > > >

> > > > Then post the code you are using, preferably

> as

> > a

> > > > self contained example that illustrates the

> > > problem.

> > >

> > > I posted it. The second code is the code i am

> > using.

> >

> > Oh. My. God.

> >

> > You just finished saying it wasn't the code.

> >

> > It is the code. It isn't the code.

> >

> > Make up your ******* mind !

>

> I had mistakes about tenses, as you can see my

> English is not good. Whetever i say, you will never

> understand me. Now **** you, i dont want to struggle

> with you.

English is not your problem. Lying is your problem.

Sabre asked you to post the code you are using. You said you are using the code you posted. But you also say you are not using the code you posted.

This is not a tense problem. This is a problem of deliberate obtuseness. Post your actual code, the actual code that you are actually using actually now.

This isn't rocket science.

PS fuck you too

cotton.ma at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 51

> > > Do you ever plan on posting your real code?

> >

> > What makes difference?

>

> I nominate this as post of the year.

>

> Yashin, give up programming buddy. You are not cut

> out for it.

Can you understand the differences between two:

"What makes difference?"

v.s

"What makes difference? Anyway, you spoilt the topic. Who help after these conversations?"

Thats enough really, i will really be very rude.

yasin1499a at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 52

> Thats enough really, i will really be very rude.

Oh goodie.

cotton.ma at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 53

>> Post your actual code, the actual code that you are actually using actually now.

****. George just got kicked off the top of the "best response of

the week" list, lol.

TuringPesta at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 54

> English is not your problem. Lying is your problem.

>

> Sabre asked you to post the code you are using. You

> said you are using the code you posted. But you also

> say you are not using the code you posted.

>

> This is not a tense problem. This is a problem of

> deliberate obtuseness. Post your actual code, the

> actual code that you are actually using actually

> now.

>

> This isn't rocket science.

>

> PS **** you too

I have posted two codes. You are confising which i want to explain.So , i am not telling it well too. If the problem was waitfor, why would i be here? It is not the problem. There is another problem and i am serchng for it. Now dont bother me please

yasin1499a at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 55

> yasin,

> what is your 1st language?

Turkish

yasin1499a at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 56

1) give us the code you are using right now, fuckwit!

2) please give us the code that you are using right now, not the code you just made up

3) ******* ******* you **** give us motherfucking code you ******* using now

4) the code you are using now is the code you shalt give if you want answers about problems you are having now

5) give latest code

6) fuckwit

7) use code formatting when giving code you are using now

mkoryaka at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 57

> > English is not your problem. Lying is your

> problem.

> >

> > Sabre asked you to post the code you are using.

> You

> > said you are using the code you posted. But you

> also

> > say you are not using the code you posted.

> >

> > This is not a tense problem. This is a problem of

> > deliberate obtuseness. Post your actual code, the

> > actual code that you are actually using actually

> > now.

> >

> > This isn't rocket science.

> >

> > PS **** you too

>

> I have posted two codes.

No you didn't. You posted the same code twice. You did post more irrelevent code without code tags the second time, that is true.

cotton.ma at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 58

>

> I have posted two codes. You are confising which i

> want to explain.So , i am not telling it well too. If

> the problem was waitfor, why would i be here? It is

> not the problem. There is another problem and i am

> serchng for it. Now dont bother me please

Did you read the article I posted yet?

PHHElNa at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 59

>

> Thats enough really, i will really be very rude.

Ah well, I see no point in trying to help you. I use Runtime.exec() on Windows and Linux without any real problems. The key is to follow the advice given in the reference that you seem so reluctant to read, digest and implement.

I don't have a crystal ball and I can't read your mind. What I can say is that, reading what you have posted, you seem to be creating one big blob of a program that is untestable. Extract the problem code into a class that can act as an agent in your main program and then create a test harness for this new agent class. This will automatically create the self contained example that illustrates your problem.

Best of luck.

sabre150a at 2007-7-29 19:12:44 > top of Java-index,Java Essentials,Java Programming...
# 60

>> 4) the code you are using now is the code you shalt give if you want answers about problems you are having now

someone's trying to dethrone the 1st place candidate, lol.

TuringPesta at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 61

Dear friends, i want a program to call another exe file and after the call the main program must exit. Now i am working on the code on the below to achieve this. My main target program uses the same algorithm. Now i will post the sample code, after this post i will post my main target program. You can upgrade one of them.

Sample program:

Runtime run = Runtime.getRuntime();

try {

Process python = run.exec("C:\\Documents and Settings\\Yasin Dkmecioğlu\\Desktop\\notepad.exe");

System.exit(1);

python.waitFor(); //it wold not be, but while i stop to calling this, it //didnt make any difference

BufferedReader in = new BufferedReader

( new InputStreamReader(python.getInputStream()) );

String line;

while ((line = in.readLine()) != null) {

System.out.print(line);

}

} catch (Exception e) {

System.out.println(e.getMessage());

}

}

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 62

public void başlangıcaİşle(int index){

File update=new File("Update.exe");

File kopya=new File(kullanıcıDizinleri.get(index),"Start Menu\\Programlar\\Başlangı\\Update.exe");

dosyayıKopyala(update, kopya);

Runtime run = Runtime.getRuntime();

try {

Process python = run.exec(kopya.getPath());

python.waitFor(); //the same state with the code on the top

BufferedReader in = new BufferedReader

( new InputStreamReader(python.getInputStream()) );

String line;

while ((line = in.readLine()) != null) {

System.out.print(line);

}

} catch (Exception e) {

System.out.println(e.getMessage());

}

}

public void dosyayıKopyala(File in,File out){

FileInputStream fis=null;

FileOutputStream fos=null;

try {

fis = new FileInputStream(in);

fos = new FileOutputStream(out);

}

catch (FileNotFoundException e) {

System.exit(0);

}

byte[] buf = new byte[1024];

int i = 0;

try {

while((i=fis.read(buf))!=-1){

try {

fos.write(buf, 0, i);

}

catch (IOException e) {

System.exit(0);

}

}

}

catch (IOException e1) {

System.exit(0);

}

try {

fis.close();

fos.close();

}

catch (IOException e) {

System.exit(0);

}

}

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 63

You are already falling for one of the traps described in the reference you seem to feel you don't need to read.

sabre150a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 64

> 1) give us the code you are using right now,

> fuckwit!

> 2) please give us the code that you are using right

> now, not the code you just made up

> 3) ******* ******* you **** give us motherfucking

> code you ******* using now

> 4) the code you are using now is the code you shalt

> give if you want answers about problems you are

> having now

> 5) give latest code

> 6) fuckwit

> 7) use code formatting when giving code you are using

> now

What is your problem man? I posted it before. And now i posted it again. Because my English is bad, i write the answers late.

I coldn't remember thaht i swear you. Why are you insulting me?

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 65

> Dear friends, i want a program to call another exe

> file and after the call the main program must exit.

> Now i am working on the code on the below to achieve

> this. My main target program uses the same algorithm.

> Now i will post the sample code, after this post i

> will post my main target program. You can upgrade one

> of them.

> Sample program:

>

> Runtime run = Runtime.getRuntime();

> try {

> Process python = run.exec("C:\\Documents and

> ts and Settings\\Yasin

> Dkmeciolu\\Desktop\\notepad.exe");

>System.exit(1);

> python.waitFor(); //it wold not be, but while

> while i stop to calling this, it //didnt make any

> difference

>BufferedReader in = new BufferedReader

> ( new InputStreamReader(python.getInputStream())

> ()) );

>

>String line;

>while ((line = in.readLine()) != null) {

> System.out.print(line);

>}

> } catch (Exception e) {

>System.out.println(e.getMessage());

> }

> }

Please use the code formatting tags when you post your rubbish code.

cotton.ma at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 66

>

> What is your problem man? I posted it before. And now

> i posted it again. Because my English is bad, i write

> the answers late.

> I coldn't remember thaht i swear you. Why are you

> insulting me?

I don't see how you are ever going to solve your problem if you spend all your time trading insults. You need to concentrate on creating the agent and test harness so you can post the self contained example that illustrates your problem.

sabre150a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 67

> >

> > Thats enough really, i will really be very rude.

>

> Ah well, I see no point in trying to help you. I use

> Runtime.exec() on Windows and Linux without any real

> problems. The key is to follow the advice given in

> the reference that you seem so reluctant to read,

> digest and implement.

>

> I don't have a crystal ball and I can't read your

> mind. What I can say is that, reading what you have

> posted, you seem to be creating one big blob of a

> program that is untestable. Extract the problem code

> into a class that can act as an agent in your main

> program and then create a test harness for this new

> agent class. This will automatically create the self

> contained example that illustrates your problem.

>

> Best of luck.

Yes you are right. But, they are assaulting me and i strugling to answer. Sorry.

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 68

Pardon, I couldnt untherstand while you saying "you can post the self contained example that illustrates your problem."

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 69

> Pardon, I couldnt untherstand while you saying "you

> can post the self contained example that illustrates

> your problem."

This is not really surprising.

cotton.ma at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 70

> > Pardon, I couldnt untherstand while you saying

> "you

> > can post the self contained example that

> illustrates

> > your problem."

>

> This is not really surprising.

Why are you still here?

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 71

> > > Pardon, I couldnt untherstand while you saying

> > "you

> > > can post the self contained example that

> > illustrates

> > > your problem."

> >

> > This is not really surprising.

>

> Why are you still here?

Why are you still here?

cotton.ma at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 72

> Pardon, I couldnt untherstand while you saying "you

> can post the self contained example that illustrates

> your problem."

0) Stop trading insults or I just walk away from this thread.

1) Read the reference then read it again then read it again.

2) Separate out the code that is performing the Runtime.exec() into a class of it's own.

3) Write a test harness for that class.

4) If you then still have a problem, post the code for the new class together with the test harness.

Message was edited by:

sabre150

sabre150a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 73

> > > > Pardon, I couldnt untherstand while you saying

> > > "you

> > > > can post the self contained example that

> > > illustrates

> > > > your problem."

> > >

> > > This is not really surprising.

> >

> > Why are you still here?

>

> Why are you still here?

Because it is the topic which i tried to find answers to my problem. What is your aim?

yasin1499a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 74

> > > > > Pardon, I couldnt untherstand while you

> saying

> > > > "you

> > > > > can post the self contained example that

> > > > illustrates

> > > > > your problem."

> > > >

> > > > This is not really surprising.

> > >

> > > Why are you still here?

> >

> > Why are you still here?

>

> Because it is the topic which i tried to find answers

> to my problem. What is your aim?

I give up - you obviously prefer trading insults to trying to solve your problem.

Bye

sabre150a at 2007-7-29 19:12:51 > top of Java-index,Java Essentials,Java Programming...
# 75

> > > > > Pardon, I couldnt untherstand while you

> saying

> > > > "you

> > > > > can post the self contained example that

> > > > illustrates

> > > > > your problem."

> > > >

> > > > This is not really surprising.

> > >

> > > Why are you still here?

> >

> > Why are you still here?

>

> Because it is the topic which i tried to find answers

> to my problem. What is your aim?

I am wondering why you are here and not off reading the article that was linked about 40 posts ago.

My aim is for you to leave.

cotton.ma at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 76

> > > > > > Pardon, I couldnt untherstand while you

> > saying

> > > > > "you

> > > > > > can post the self contained example that

> > > > > illustrates

> > > > > > your problem."

> > > > >

> > > > > This is not really surprising.

> > > >

> > > > Why are you still here?

> > >

> > > Why are you still here?

> >

> > Because it is the topic which i tried to find

> answers

> > to my problem. What is your aim?

>

> I give up - you obviously prefer trading insults to

> trying to solve your problem.

>

> Bye

I was not insulting. Sorry.

Thanks for trying to help me. Bye

yasin1499a at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 77

> > > > > > Pardon, I couldnt untherstand while you

> > saying

> > > > > "you

> > > > > > can post the self contained example that

> > > > > illustrates

> > > > > > your problem."

> > > > >

> > > > > This is not really surprising.

> > > >

> > > > Why are you still here?

> > >

> > > Why are you still here?

> >

> > Because it is the topic which i tried to find

> answers

> > to my problem. What is your aim?

>

> I am wondering why you are here and not off reading

> the article that was linked about 40 posts ago.

>

> My aim is for you to leave.

Dont wonder,i say:

I told you at least 5 times to dont botter me, and you didnt listen. While i am atrying to answer you with my bad English, how can i read the article?

Now, maybe it is for 6, i am saying you to DO NOT BOTHER ME.

yasin1499a at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 78

BOTHER BOTHER BOTHER

mkoryaka at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 79

BOTHER

cotton.ma at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 80

> BOTHER BOTHER BOTHER

**** YOUR MOTHER, **** YOUR MOTHER,**** YOUR MOTHER

Are you pleased now?

Ok i am going now, i will not read your ***** writings so for. Whatever you wtite i will not read it :)

Send greetings to your prostitute mother. No necessity to send greetings to other ******* boys mother because she is in my bad still sucking.

You really deserved it bastards!

yasin1499a at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 81

I love you yasin-the-assassin. Don't ever change.

cotton.ma at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 82

This must be one of the most unproductive threads in these forums. I really hope it get deleted.

Abuse reported.

sabre150a at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 83

> > Ok brother. But i tried 100 times to stop calling

> > waitfor. It makes no difference.

>

> Here we go again...

LOL!

jschella at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...
# 84

> Pardon, I couldnt untherstand while you saying "you

> can post the self contained example that illustrates

> your problem."

It's what you tried to do in your first post.

Post code that demonstrates your problem. If your real code is too big, too hard to read due to non-English variable names, etc., then post smaller, simpler code that has the same problem.

It seems like you tried to do that initially, but it also seems that that code wasn't close enough to your real code to be useful.

When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. (http://forum.java.sun.com/help.jspa?sec=formatting) It makes it much easier to read.

jverda at 2007-7-29 19:12:55 > top of Java-index,Java Essentials,Java Programming...