3 Replies Latest reply: Sep 24, 2006 8:36 AM by 807569 RSS

    what are the cases that cause the I/O error writing to output file

    807569
      may i ask what are the cases that cause the I/O error writing to output file ??

      cause i have the write path and the input file has data

      any ideas???
        • 1. Re: what are the cases that cause the I/O error writing to output file
          807569
          The input file has nothing to do with the output file.

          Maybe the path (to the output file) isn't actually right.
          Maybe the path is right, but you don't have the right permissions to create or alter the target file.

          All sorts of things can happen. That's why the error messages and stack traces contain helpful information for you to solve the problem. What error message and stack trace did you get?
          • 2. Re: what are the cases that cause the I/O error writing to output file
            807569
            The path is correct because the file has been created but nothing is written to it

            and the permission is to write first time then append to it

            the error message is a the title of the message

            I/O error writing to output file
            • 3. Re: what are the cases that cause the I/O error writing to output file
              807569
              and the permission is to write first time then append to it
              By "permission" is meant the operating system controlled rights that let
              particular users do specified things with specified files or directories.
              the error message is a the title of the message
              I/O error writing to output file
              The java runtime actually creates a much more useful error message than
              this but, unfortunately, your program is swallowing this error message and
              replacing it with the message you see.

              Somewhere in your code you have something like:
              try {
                  // all sorts of stuff goes here
                  // including the code that is intended to
                  // write to the file
              } catch(IOException ioe) {
                  System.out.println("I/O error writing to output file");
                      // add this line
                  //ioe.printStackTrace();
              }
              It might say Exception rather than IOException.

              To get a much more useful error message add the commented line.