MCPcopy Index your code
hub / github.com/questdb/questdb / getDirSize

Method getDirSize

core/src/main/java/io/questdb/std/Files.java:185–208  ·  view source on GitHub ↗
(Path path)

Source from the content-addressed store, hash-verified

183 }
184
185 public static long getDirSize(Path path) {
186 long pFind = findFirst(path.$().ptr());
187 if (pFind > 0L) {
188 int len = path.size();
189 try {
190 long totalSize = 0L;
191 do {
192 long nameUtf8Ptr = findName(pFind);
193 path.trimTo(len).concat(nameUtf8Ptr).$();
194 if (findType(pFind) == Files.DT_FILE) {
195 totalSize += length(path.$());
196 } else if (notDots(nameUtf8Ptr)) {
197 totalSize += getDirSize(path);
198 }
199 }
200 while (findNext(pFind) > 0);
201 return totalSize;
202 } finally {
203 findClose(pFind);
204 path.trimTo(len);
205 }
206 }
207 return 0L;
208 }
209
210 public static long getDiskFreeSpace(LPSZ path) {
211 if (path != null) {

Callers 9

testDeleteDirMethod · 0.95
findPartitionSizesMethod · 0.95
getDirSizeMethod · 0.95
getTableStatsMethod · 0.95
getDirSizeMethod · 0.95

Calls 12

findFirstMethod · 0.95
findNameMethod · 0.95
findTypeMethod · 0.95
lengthMethod · 0.95
notDotsMethod · 0.95
findNextMethod · 0.95
findCloseMethod · 0.95
concatMethod · 0.80
ptrMethod · 0.65
$Method · 0.65
sizeMethod · 0.65
trimToMethod · 0.65