MCPcopy Index your code
hub / github.com/nodejs/node / validateReadFileProc

Function validateReadFileProc

test/parallel/test-fs-promises-file-handle-readFile.js:36–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36async function validateReadFileProc() {
37 // Test to make sure reading a file under the /proc directory works. Adapted
38 // from test-fs-read-file-sync-hostname.js.
39 // Refs:
40 // - https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0
41 // - https://github.com/nodejs/node/issues/21331
42
43 // Test is Linux-specific.
44 if (!common.isLinux)
45 return;
46
47 await using fileHandle = await open('/proc/sys/kernel/hostname', 'r');
48 const hostname = await fileHandle.readFile();
49 assert.ok(hostname.length > 0);
50}
51
52async function doReadAndCancel() {
53 // Signal aborted from the start

Callers

nothing calls this directly

Calls 3

openFunction · 0.70
readFileMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…