Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By JosAH

Thread: End-Of-File indicator problem?

  1. #1
    mjzhaochenyi is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Cool End-Of-File indicator problem?

    when i want to input EoF indicator during program running , i never success on it as to i cant save info into text file using class Formatter method format.
    i got a dell laptop with win 7 x86!
    could anybody can help me out there. any attention is appreciated.
    Last edited by JosAH; 10-02-2011 at 09:57 AM. Reason: removed the preposterous big font tags

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,437
    Blog Entries
    7
    Rep Power
    20

    Default Re: End-Of-File indicator problem?

    The end-of-file indicator only exists 'logically', i.e. it cannot be found in a fle or an InputStream reading from that file or any other data source. Those InptStreams read byes and return them as ints in the range [0,255]; it returns a -1 when it 'bumped' into an end-of-file condition. For interactive Streams, typing Ctrl-D (on Unices) or Ctrl-Z (on MS Windows) raises that condition. b.t.w. the brand of your laptop has nothing to do with this.

    kind regards,

    Jos
    mjzhaochenyi likes this.
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    mjzhaochenyi is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Re: End-Of-File indicator problem?

    thanks for your attention. my problem is just that i cant input ctrl z on my keyboard. everytime i press ctrl+z , no reaction with the program!

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,437
    Blog Entries
    7
    Rep Power
    20

    Default Re: End-Of-File indicator problem?

    Quote Originally Posted by mjzhaochenyi View Post
    thanks for your attention. my problem is just that i cant input ctrl z on my keyboard. everytime i press ctrl+z , no reaction with the program!
    Are you using an IDE for running your program? If so you have to come up with a sentinel value (e.g. "stop" or "quit"); when your program reads such a line it should stop. Otherwise typing Crtl-Z at the start of a line raises an end-of-file condition on the standard input stream.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    mjzhaochenyi is offline Member
    Join Date
    Oct 2011
    Posts
    4
    Rep Power
    0

    Default Re: End-Of-File indicator problem?

    sorry. brother. im a totally new fish for java. i feel a little confused with this. could u tell me how to do that exactly? thanks a lot!!

Similar Threads

  1. jxtable sort indicator
    By new2java2009 in forum New To Java
    Replies: 0
    Last Post: 07-18-2011, 06:04 PM
  2. Got problem with jar-file, any help?
    By Igbear in forum Advanced Java
    Replies: 7
    Last Post: 11-20-2010, 09:10 PM
  3. jar file problem
    By abhijit in forum New To Java
    Replies: 12
    Last Post: 02-12-2010, 09:06 AM
  4. problem with jar file pls help
    By jinu5 in forum New To Java
    Replies: 0
    Last Post: 08-15-2007, 10:41 PM
  5. indicator ajaxtags
    By Peter in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-04-2007, 06:51 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •