How get list Provides a handle to a directory entry in File System Access API?

88 Views Asked by At

I am get directory from file system and read data.

 try {
   const directoryHandle = await showDirectoryPicker({
         startIn: startIn.value,
   });
   for await (const [name, fileHandle] of directoryHandle) {
      directory.textContent =  directory.textContent + `${name} - ${fileHandle.kind}`
    }
 }
 catch (e) {
    console.log(e);
 }

then I want to get data from this directory and i want to get list all directoryes.

I am try this

const opfsRoot = await  navigator.storage.getDirectory(); 
const existingDirectoryHandle = await opfsRoot.getDirectoryHandle('Directory');

But i can't see my directory.

How can I get an already added directory ? How can I get a list of added directories ?

0

There are 0 best solutions below