Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

synchronisation error  RSS feed

 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a file which if exists should print "got it" else it should print "not got it".Gettin boolean value through for this through res.getres().Now follwoing are two files.Issue is when file is there i get the correct message but when file is not there I am not getting any messgae.




[HENRY: Added code tags]
[ October 29, 2006: Message edited by: Henry Wong ]
 
Henry Wong
author
Sheriff
Posts: 22840
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in the example that you've shown that prints either "got it" or "not got it".

Henry
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi this is third file to get it
if (res.getres()){
System.out.println("got it")

else{
System.out.println(" not got it")
}
where res.getres returning boolean value
 
Henry Wong
author
Sheriff
Posts: 22840
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "not got it" message will never print. The reason is because the getres() method will always return true -- while the avai variable is false it will wait.

Henry
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi how to rectify this
regards
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!