Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225507

(zipfs): No space left on device not thrown with ZipFileSystem

XMLWordPrintable

    • x86_64
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      I save several files in a zip file using Java's FileSystem. If there is not enough disk space I can not get 'java.io.IOException No space left on device' and it behaves as if the zip file were created successfully.

      Here is a snippet from my project:

      Path pathToZip = Paths.get("path/to/existing/zip");

      try(FileSystem fs = FileSystems.newFileSystem(pathToZip, null)) {
          // zip some files via
          Path pathToSomeFile = Paths.get("path/of/some/file/to/be/zipped");
          Files.copy(pathToSomeFile, fs.getPath("/path/of/some/file/to/be/zipped"));
      } catch (IOException ex) {
          log.error("error on zipping files", ex);
      }

      The 'FileSystems.newFileSystem(pathToZip, null)' creates a 'ZipFileSystem' instance. I've debugged up to the method 'sync()' of the class 'ZipFileSystem'. Then, when the 'java.io.IOException No space left on device' occurs, only 'x.printStackTrace()' is called and the exception is gone.


      FREQUENCY : always


            lancea Lance Andersen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: