Search in sources :

Example 6 with NativeLPSZ

use of com.questdb.std.str.NativeLPSZ in project questdb by bluestreak01.

the class $TabsRecordSource method countDirs.

private static int countDirs(LPSZ path) {
    int count = 0;
    long find = Files.findFirst(path);
    if (find == 0) {
        return 0;
    }
    NativeLPSZ file = tlNativeLpsz.get();
    try {
        do {
            file.of(Files.findName(find));
            if (Files.isDots(file)) {
                continue;
            }
            if (Files.findType(find) == Files.DT_DIR) {
                count++;
            }
        } while (Files.findNext(find) > 0);
    } finally {
        Files.findClose(find);
    }
    return count;
}
Also used : NativeLPSZ(com.questdb.std.str.NativeLPSZ)

Aggregations

NativeLPSZ (com.questdb.std.str.NativeLPSZ)6 Path (com.questdb.std.str.Path)5 Chars (com.questdb.std.Chars)1 ObjList (com.questdb.std.ObjList)1 DirectCharSequence (com.questdb.std.str.DirectCharSequence)1 LPSZ (com.questdb.std.str.LPSZ)1 Test (org.junit.Test)1