• Post Reply Bookmark Topic Watch Topic
  • New Topic

whaiting for file

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do handle a situation where I want to be in a while loop while a specific file has not been created yet?
thanks,
Alex
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can poll for the file's existence with something like
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, I tried that but I get FilePermission error. I am trying to read from HTTP:

I get

However, when I print out url.toString(), I get http://127.0.0.1/generic2/tmp/8003.res
What am I doing wrong?
thanks,
Alex
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't associate a File with a URL like that. URLs aren't "file names".
[ February 10, 2004: Message edited by: Billybob Marshall ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,
You seem to be conflating the concepts of a file path and a network URL. You're handing a network URL to File's constructor, and it's trying to interpret it as a file on drive "http:"! The permission error is probably due to the fact that applets, by default, aren't allowed to access local files unless they're digitally signed.
So is this an applet waiting for a file to appear on the web server? That's quite different from what I got from your original message, that it was an application waiting for a file to appear on the local machine.
I suppose you'd have to do something like this to poll for a file on a web server:

[ February 10, 2004: Message edited by: Ernest Friedman-Hill ]
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks sheriff,
Work just like I need to...got to read up on this stuff.
Alex
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!