added directory snapshot

This commit is contained in:
2021-03-09 16:05:24 -06:00
parent b553984808
commit e783d490a7
4 changed files with 354 additions and 295 deletions

View File

@@ -102,6 +102,19 @@ await api.directory.list('/', async (remote_path, page_count, get_page) => {
}
});
// Asynchronous directory list
const snap = await api.directory.snapshot('/');
try {
for (let i = 0; i < snap.page_count; i++) {
const items = await snap.get_page(i); // Always 'await'
console.log(items);
}
} catch (err) {
console.log(err);
} finally {
await snap.release();
}
// Create new directory
await api.directory.create('/test');