Skip to content

FileStore.getBlockSize() should return the configuration block size #183

@ogregoire

Description

@ogregoire

The following test case fails for some reason.

  @Test
  void test() throws IOException {
    var blockSize = 1 << 12;
    var configuration = Configuration.unix().toBuilder().setBlockSize(blockSize).build();
    var fs = Jimfs.newFileSystem(configuration);
    var path = fs.getPath("/home/test/test.txt");
    var store = Files.getFileStore(path);
    assertThat(store.getBlockSize()).isEqualTo(blockSize);
  }

I'm explicitly setting the block size, but I get an IOException when the test case is run:

java.lang.UnsupportedOperationException
        at java.base/java.nio.file.FileStore.getBlockSize(FileStore.java:158)
        ...

I would expect the store to return the block size instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4type=defectBug, not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions