Loading

Quipoin Menu

Learn • Practice • Grow

node-js / File System Advanced
mcq
Direction: Choose the correct option

Q1.

What is a file descriptor in Node.js?
A. A string representing the file path
B. A buffer containing file data
C. A boolean indicating file existence
D. An integer uniquely identifying an open file
Direction: Choose the correct option

Q2.

Which method is used to open a file and get a file descriptor?
A. fs.open()
B. fs.openFile()
C. fs.createDescriptor()
D. fs.getFD()
Direction: Choose the correct option

Q3.

What does the flag 'r' mean in `fs.open()`?
A. Read mode
B. Append mode
C. Write mode
D. Create mode
Direction: Choose the correct option

Q4.

Which method is used to change file permissions?
A. fs.chown()
B. fs.permission()
C. fs.setMode()
D. fs.chmod()
Direction: Choose the correct option

Q5.

What is the purpose of `fs.createReadStream()`?
A. To read large files efficiently in chunks
B. To read a file line by line
C. To read a file synchronously
D. To create a new file