How to get the full path of a dirEntry?

24 Views Asked by At

I want to Deno.readDir() a path and get the full path of each dirEntry. The problem is that the Deno.DirEntry interface doesn't provide a full path property. Is there a way to solve this?

1

There are 1 best solutions below

0
Ooker On
import { join } from "$std/path/mod.ts";
const path = "D:\\path\\to\\root"
for await (const dirEntry of Deno.readDir(path)) {
  console.log(join(path, dirEntry.name))
}