• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FileDescriptor

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
what is FileDescriptor class in java.io package?
According to APIs :
Instances of FileDescriptor class serve as an opaque handle to the underlying machine-specific structure representing an open file,an open socket or another source or sink of bytes.
Main use of FileDescriptor is to create FileInputStream or FileOutputStream to contain it.

i am unable to understand what is the difference between a File object and FileDescriptor object?
Any help would be appreciated.
rajashree.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The File class provides a platform independent way to manipulate information about files and directories, create and delete files and directories, etc..
FileDescriptor is not a general class - like you quoted from the API, it encapsulates some very system specific details - essentially a file handle. There is very little reason for most programmers to ever use a FileDescriptor.
Bill
 
rajashree ghatak
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Bill.
i would like to know why are err,in & out said to be FileDesciptors according to Java2 APIs.
also, why new FileDescriptor() constructs an (invalid) FileDescriptor object?

rajashree.
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic