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 7853617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:45:02+00:00 2026-06-02T19:45:02+00:00

import java.io.FileReader; public class SimpoTest { public static void main(String[] args) { FileReader fileReader

  • 0
import java.io.FileReader;

public class SimpoTest {

    public static void main(String[] args) {
        FileReader fileReader = null;
        try {
            fileReader = new FileReader("/home/brian/Desktop/me");
            int read = fileReader.read();
            System.out.println((char) read);
        } catch (Exception e) {
            fileReader = null;
            e.printStackTrace();
        }
    }
}

1\ echo “1” > /home/brian/Desktop/me
2\ set the breakpoint to “int read = fileReader.read();”
3\ start the debug
4\ rm -f /home/brian/Desktop/me
5\ jump to the end <======== the “1” still outputted on the console…

well…this is really weird to me. as i though there should be an exception thrown out.
can anyone give any explanation?
any comments or suggestions are appreciated.

  • 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-06-02T19:45:03+00:00Added an answer on June 2, 2026 at 7:45 pm

    This is expected behavior at least on a unix-like operating system: as long as there’s an open file descriptor to it, the rm’d file’s blocks will remain allocated and accessible via that file descriptor.

    I expect you cannot, however, open a new file descriptor to them by means of the deleted filename.

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

Sidebar

Related Questions

import java.io.*; import java.util.Scanner; import java.util.StringTokenizer; public class Filereader { public static void main(String[]
import java.lang.Math; public class NewtonIteration { public static void main(String[] args) { System.out.print(rootNofX(2,9)); }
import java.io.*; import java.util.*; public class Readfilm { public static void main(String[] args) throws
import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import java.io.FileReader; public class Main { public static void main(String[]
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DateDemo { public static void main(String[]
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class InversionCounter { public static void main(String[]
package macroreader; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class MacroReader { public static
import java.lang.reflect.Array; public class PrimitiveArrayGeneric { static <T> T[] genericArrayNewInstance(Class<T> componentType) { return (T[])
import java.util.*; import java.io.*; public String recToString (boolean format) { Date date = new
import java.awt.Graphics; import javax.swing.*; public class Demo { JFrame jf; JLabel[] labels; JPanel panel;

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.