GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vfs: dispatch fs/promises to mounted VFS instances · nodejs/node@b17817e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • fs.js
    • internal
      • fs
        • dir.js
        • promises.js
        • utils.js
      • vfs
        • errors.js
        • file_system.js
        • router.js
        • setup.js
  • test/parallel
    • test-vfs-destructuring.js
    • test-vfs-fs-accessSync.js
    • test-vfs-fs-callback-error-paths.js
    • test-vfs-fs-chmod-callback.js
    • test-vfs-fs-chmodSync.js
    • test-vfs-fs-copyFileSync.js
    • test-vfs-fs-createReadStream.js
    • test-vfs-fs-createWriteStream.js
    • test-vfs-fs-existsSync.js
    • test-vfs-fs-fchmod-callback.js
    • test-vfs-fs-linkSync.js
    • test-vfs-fs-mkdir-callback.js
    • test-vfs-fs-mkdirSync.js
    • test-vfs-fs-mkdtempSync.js
    • test-vfs-fs-open-callback.js
    • test-vfs-fs-openAsBlob.js
    • test-vfs-fs-openSync.js
    • test-vfs-fs-opendir-callback.js
    • test-vfs-fs-opendirSync.js
    • test-vfs-fs-promises-buffer-encoding.js
    • test-vfs-fs-promises-stat-no-throw.js
    • test-vfs-fs-promises.js
    • test-vfs-fs-readFile-callback.js
    • test-vfs-fs-readFileSync.js
    • test-vfs-fs-readdirSync.js
    • test-vfs-fs-realpathSync.js
    • test-vfs-fs-rename-callback.js
    • test-vfs-fs-renameSync.js
    • test-vfs-fs-rmSync.js
    • test-vfs-fs-stat-callback.js
    • test-vfs-fs-statSync.js
    • test-vfs-fs-symlink-callback.js
    • test-vfs-fs-symlinkSync.js
    • test-vfs-fs-truncate-callback.js
    • test-vfs-fs-truncateSync.js
    • test-vfs-fs-watch-dispatch.js
    • test-vfs-fs-writeFile-callback.js
    • test-vfs-fs-writeFileSync.js
    • test-vfs-mount-errors.js
    • test-vfs-mount.js
    • test-vfs-multi-mount.js
    • test-vfs-router.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+547-24Lines changed: 547 additions & 24 deletions
Large diffs are not rendered by default.
Collapse file

‎lib/internal/fs/dir.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/dir.js
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const {
3131
getDirent,
3232
getOptions,
3333
getValidatedPath,
34+
vfsState,
3435
} = require('internal/fs/utils');
3536
const {
3637
validateFunction,
@@ -330,6 +331,20 @@ function opendir(path, options, callback) {
330331
callback = typeof options === 'function' ? options : callback;
331332
validateFunction(callback, 'callback');
332333

334+
const h = vfsState.handlers;
335+
if (h !== null) {
336+
try {
337+
const result = h.opendirSync(path, options);
338+
if (result !== undefined) {
339+
process.nextTick(callback, null, result);
340+
return;
341+
}
342+
} catch (err) {
343+
process.nextTick(callback, err);
344+
return;
345+
}
346+
}
347+
333348
path = getValidatedPath(path);
334349
options = getOptions(options, {
335350
encoding: 'utf8',
@@ -354,6 +369,12 @@ function opendir(path, options, callback) {
354369
}
355370

356371
function opendirSync(path, options) {
372+
const h = vfsState.handlers;
373+
if (h !== null) {
374+
const result = h.opendirSync(path, options);
375+
if (result !== undefined) return result;
376+
}
377+
357378
path = getValidatedPath(path);
358379
options = getOptions(options, { encoding: 'utf8' });
359380

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.