System Programming I – Files

This MCQ-formatted quiz focuses on system calls basics and file handling system calls.

Start Quiz

A system call is a routine built into the kernel and performs a basic function. True or false?

True

False

The CPU runs in __ mode when we execute a C program.

User

Kernel

Supervisory

System

In __mode, the kernel runs on behalf of the user.

User

Kernel

Real

All

All UNIX and LINUX systems have one thing in common, which is a ____

Set of system calls

Set of commands

Set of instructions

Set of text editors

Which of the following system call is used for opening or creating a file?

Read

Write

Open

Close

For reading input, which of the following system call is used?

Write

Rd

Read

Change

The chmod command invokes the ____ system call.

Chmod

Ch

Read

Change

There are __ modes for opening a file.

4

3

2

1

Which of the following modes is used for opening a file in both reading and writing?

O_RDONLY

O_WRONLY

O_WDR

O_RDWR

The open system call returns the file descriptor as

Int

Float

Char

Double

Which of the following commands is used to view your file 24 lines at a time?

pg

cat

lp

/p

None of the above

Which option will be used with the ps command to slow the entire command line of the running process?

-4

-f

-1

-2

None of the above

Which of the following directories contain all the Alias created by a user, including their login directory?

/tmp

/etc

/usr

/dev

None of the above

Which option is used with the rm command to prompt the user with each filename and a ? before acting on it

-r

-x

-1

-i

None of the above

Which of the following commands is used to obtain a list of all files by modification time?

ls -1

ls -t

ls -i

ls -R

None of the above

Quiz/Test Summary
Title: System Programming I – Files
Questions: 15
Contributed by:
Ivan