Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

RandomAccessFile  RSS feed

 
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can I use RandomAccessFile by connecting to url?
If yes, can someone give an example?
thanks,
Alex
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an exact question in the exam scam book from B.Brogden. Here is his explanation:
"....there is no way to create a RandonAccessFile from a URL. The basic reason is that there is no protocol for random access to files via HTTP."
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think this is a correct reason. A URL may not necessarily use HTTP.
The reason you cannot have random access to a URL is:
There is no concept of a "File Pointer" that you can move around in a URL. All you have is a stream of data. You do not have a "chunk" of data. Furthermore, you can have random access only if you have all the data buffered so that you can move the File Pointer around in that buffer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!