| 595 | } |
| 596 | |
| 597 | public static void walk(Path path, FindVisitor func) { |
| 598 | int len = path.size(); |
| 599 | long p = findFirst(path.$()); |
| 600 | if (p > 0) { |
| 601 | try { |
| 602 | do { |
| 603 | long name = findName(p); |
| 604 | if (notDots(name)) { |
| 605 | int type = findType(p); |
| 606 | path.trimTo(len); |
| 607 | if (type == Files.DT_FILE) { |
| 608 | func.onFind(name, type); |
| 609 | } else { |
| 610 | walk(path.concat(name), func); |
| 611 | } |
| 612 | } |
| 613 | } while (findNext(p) > 0); |
| 614 | } finally { |
| 615 | findClose(p); |
| 616 | } |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | public static long write(long fd, long address, long len, long offset) { |
| 621 | return write(toOsFd(fd), address, len, offset); |