Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

137
Vistas
Check if directory still exists after app reload

I am saving a FileSystemDirectoryHandle to IndexedDB, so that the web application can reuse it the next time it is started. This usually works fine. But when the directory has been removed from disk in the meantime, and the app still tries to work with it (for example by trying to obtain a file handle inside the directory via directoryHandle.getFileHandle()), an error is thrown, unsurprisingly: NotFoundError: A requested file or directory could not be found at the time an operation was processed.

How to check if the directory still exists before doing anything else with it? In Node.js, there are functions for checking if a directory exists like fs.access and fs.existsSync. But I do not find anything like that with the File System Access API.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your best option right now is indeed try..catch-ing the desired operation and checking the type of the error to equal NotFoundError. The spec has two open issues around improving this: Issue #121 and Issue #244.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda