Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3614670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:16:42+00:00 2026-05-18T22:16:42+00:00

The write() function in java appends new data to end of file. Here is

  • 0

The write() function in java appends new data to end of file. Here is my question; how the java knows end of file?

  1. By reading whole file to find end of file
  2. It knows where the end of file

Which one? Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:16:43+00:00Added an answer on May 18, 2026 at 10:16 pm

    For Unix / Linux at least, the answer is that the operating system takes care of this. Java just makes use of the operating system provided file descriptor that keeps track of the application’s current position within the file.

    • If you opened the file normally (append == false), then a write writes data at the file descriptor’s current position, and then updates it to point to the position immediately after the data just written.

    • If you opened the file in append mode (append == true), then each write writes data at the current end of file.

    Note that other Unix / Linux I/O operations use and update the current position of a file descriptor; e.g. read, seek and tell.

    Here is my question; how the java knows end of file?

    1. By reading whole file to find end of file: No

    2. It knows where the end of file: Not exactly. It is typically the operating system that knows, not
      Java.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an interview question (phone screen): write a function (in Java) to find
I am new to JavaScript. How to write JavaScript function which will return installed
This is kind of a weird question. I'd like to write a Java function
I am trying to write a Java function which has List object as output
Here is how I would write a function to make an acronym in Java
I am trying to write a recursive function in Java that prints the numbers
I am trying to write a simple Java function that will take a list
I am trying to write a Java equivalent for a function in C#. The
I have a simple file read and write function. private void WriteToFile(String filename, String
I am a newbie to Android and Java and want to write a function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.