When we want to go into a directory hierarchy, we have to keep getting FileSystemDirectoryHandle for the child, until we reach what we want. Same goes for checking if a file exists, we have to traverse through the hierarchy by keep getting FileSystemDirectoryHandle just to iterate to all entries and compare. Same goes for making directories, creating files nested in hierchies,...
What solutions exist today?
We can create a recursive function that split paths and handle relative paths and stuff.
These can take in the cwd argument for relative path, or we can even implement a current working directory global variable. If path starts with ../ then cwd must be specified
What problem are you trying to solve?
When we want to go into a directory hierarchy, we have to keep getting
FileSystemDirectoryHandle
for the child, until we reach what we want. Same goes for checking if a file exists, we have to traverse through the hierarchy by keep getting FileSystemDirectoryHandle just to iterate to all entries and compare. Same goes for making directories, creating files nested in hierchies,...What solutions exist today?
We can create a recursive function that split paths and handle relative paths and stuff.
How would you solve it?
It would be nice to have native method such as:
These can take in the
cwd
argument for relative path, or we can even implement a current working directory global variable. If path starts with../
then cwd must be specified