use of com.questdb.std.Chars in project questdb by bluestreak01.
the class FilesTest method testListDir.
@Test
public void testListDir() {
String temp = temporaryFolder.getRoot().getAbsolutePath();
ObjList<String> names = new ObjList<>();
try (Path path = new Path().of(temp).$()) {
try (Path cp = new Path()) {
Assert.assertTrue(Files.touch(cp.of(temp).concat("a.txt").$()));
NativeLPSZ name = new NativeLPSZ();
long pFind = Files.findFirst(path);
Assert.assertTrue(pFind != 0);
try {
do {
names.add(name.of(Files.findName(pFind)).toString());
} while (Files.findNext(pFind) > 0);
} finally {
Files.findClose(pFind);
}
}
}
names.sort(Chars::compare);
Assert.assertEquals("[.,..,a.txt]", names.toString());
}
Aggregations