1 Reply Latest reply on Apr 8, 2002 10:41 AM by stollar

    Help please!!

    stollar

      I have a servlet and I can not get it to write to the local file system.

      I have created a File (f) and a FileWriter (fw) but calling f.canWrite() returns false. Is there some security issues at play here and how can I overcome them?

      Code is something like this...

      File f = new File("/tmp/myfile.txt");
      FileWriter fw = new FileWriter(f);
      if (f.canWrite())
      fw.write("hello World");
      else
      System.err.println("Can't Write to file");


      Any help is much appreciated...