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?

  1. A.

    It is used to copy files from one location to another.

  2. B.

    It opens an existing file but cannot create new files.

  3. C.

    It only creates new files in a directory.

  4. 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.

Explore the full course: Niacl Ao It Specialist