What is the purpose of the CreateFile() system call in Windows operating system?
2025
What is the purpose of the CreateFile() system call in Windows operating system?
- A.
It is used to copy files from one location to another.
- B.
It opens an existing file but cannot create new files.
- C.
It only creates new files in a directory.
- D.
It can create a new file or open an existing one.
Attempted by 10 students.
Show answer & explanation
Correct answer: D
CreateFile() is a Windows API system call used for file and device handling. It can create a new file, open an existing file, or access devices such as disks and printers. Its behavior depends on parameters like access permissions and creation options.