• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

whaiting for file

 
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
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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
 
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
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic