Lines Matching full:dir
47 const dir = fs.opendirSync(testDir); constant
49 const dirent = dir.readSync();
55 // dir.read should return null when no more entries exist
56 assert.strictEqual(dir.readSync(), null);
59 assert.strictEqual(dir.path, testDir);
61 dir.closeSync();
63 assert.throws(() => dir.readSync(), dirclosedError);
64 assert.throws(() => dir.closeSync(), dirclosedError);
68 fs.opendir(testDir, common.mustSucceed((dir) => {
70 dir.read(common.mustCall((err, dirent) => {
79 dir.read(common.mustCall((err, dirent) => {
83 dir.close(common.mustSucceed());
123 const dir = await fs.promises.opendir(testDir);
128 const dirent = await dir.read();
135 // dir.read should return null when no more entries exist
136 assert.strictEqual(await dir.read(), null);
138 await dir.close();
159 const dir = await fs.promises.opendir(testDir);
160 for await (const dirent of dir) { // eslint-disable-line no-unused-vars
164 await assert.rejects(async () => dir.read(), dirclosedError);
169 const dir = await fs.promises.opendir(testDir);
171 for await (const dirent of dir) { // eslint-disable-line no-unused-vars
176 await assert.rejects(async () => dir.read(), dirclosedError);
181 const dir = await fs.promises.opendir(testDir);
183 for await (const dirent of dir) { // eslint-disable-line no-unused-vars
192 await assert.rejects(async () => dir.read(), dirclosedError);
214 const dir = fs.opendirSync(testDir, { bufferSize: 1024 }); constant
215 assertDirent(dir.readSync());
216 dir.close();
221 const dir = await fs.promises.opendir(testDir);
222 assert.throws(() => dir.close('not function'), invalidCallbackObj);
228 const dir = await fs.promises.opendir(testDir);
229 await dir.close();
230 await assert.rejects(() => dir.close(), dirclosedError);
236 const dir = await fs.promises.opendir(testDir);
237 const promise = dir.read();
239 assert.throws(() => dir.closeSync(), dirconcurrentError);
240 assert.throws(() => dir.readSync(), dirconcurrentError);
243 dir.closeSync();
249 const dir = fs.opendirSync(testDir); constant
250 assert.throws(() => dir.read('INVALID_CALLBACK'), /ERR_INVALID_CALLBACK/);
255 const dir = await fs.promises.opendir(testDir);
256 const promise1 = dir.read();
257 const promise2 = dir.read();
261 dir.closeSync();
267 const dir = await fs.promises.opendir(testDir);
268 const promise1 = dir.read();
269 const promise2 = dir.close();
278 const dir = fs.opendirSync(testDir); constant
279 dir.closeSync();
280 dir.close(common.mustCall((error) => {
287 const dir = fs.opendirSync(testDir); constant
288 dir.closeSync();
289 assert.rejects(dir.close(), dirclosedError).then(common.mustCall());