Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 38
Q861:
If no filename is specified in the search pattern, the program uses ________ as default.
A. *
B. ?
C. .
D. #
Correct Answer: A
Chapter: 38
Q862:
The parent path in the search pattern includes the ________.
A. prefix with a slash
B. suffix without a slash
C. file name
D. extension
Correct Answer: A
Chapter: 38
Q863:
The suffix in the search pattern is the longest part ________.
A. not containing a slash
B. containing only slashes
C. containing a dot
D. ending with slash
Correct Answer: A
Chapter: 38
Q864:
If pathLength returned by getCurrentDirectory() is 0 or greater than MAX_PATH_LONG, the program will ________.
A. report an error
B. continue silently
C. retry
D. get a new path
Correct Answer: A
Chapter: 38
Q865:
The maximum path length constant MAX_PATH_LONG is set to ________.
A. 32780
B. 260
C. 1024
D. 65536
Correct Answer: A
Chapter: 38
Q866:
In the code, ReportError() is called with the message ________.
A. GetCurrentDirectory failed
B. File not found
C. Access denied
D. Operation successful
Correct Answer: A
Chapter: 38
Q867:
The wildcard character used in searchPattern if no file is specified is ________.
A. *
B. ?
C. #
D. %
Correct Answer: A
Chapter: 38
Q868:
The code snippet indicates that the search pattern is split into parent and filename based on the presence of ________.
A. a slash
B. a dot
C. a colon
D. a space
Correct Answer: A
Chapter: 39
Q869:
The UNIX command used to change file access time to the current system time is ________.
A. touch
B. change
C. date
D. ls
Correct Answer: A
Chapter: 39
Q870:
GetSystemTimeAsFileTime() retrieves the current system time in ________ format.
A. Local time
B. Coordinated Universal Time (UTC)
C. Unix time
D. Windows time
Correct Answer: B
Chapter: 39
Q871:
GetSystemTime() returns the current system date and time in ________ format.
A. Local time
B. Coordinated Universal Time (UTC)
C. Timestamp
D. ISO format
Correct Answer: B
Chapter: 39
Q872:
GetSystemTimeAsFileTime() requires a ________ as an argument.
A. file pointer
B. handle
C. file descriptor
D. file path
Correct Answer: A
Chapter: 39
Q873:
GetSystemTime() stores the current date and time in a ________ structure.
A. FILETIME
B. SYSTEMTIME
C. TIMESTAMP
D. DATETIME
Correct Answer: B
Chapter: 39
Q874:
SetFileTime() is used to set the date and time for ________.
A. files or directories
B. only files
C. only directories
D. system events
Correct Answer: A
Chapter: 39
Q875:
Which API is more convenient to get system time directly as file time?
A. GetSystemTime
B. GetSystemTimeAsFileTime
C. SystemTimeToFileTime
D. SetFileTime
Correct Answer: B
Chapter: 39
Q876:
The header file sysinfoapi.h provides functions to retrieve ________.
A. system time
B. file attributes
C. file paths
D. directory info
Correct Answer: A
Chapter: 39
Q877:
SetFileTime() can be used to set all except ________.
A. file size
B. creation time
C. last access time
D. last modified time
Correct Answer: A
Chapter: 39
Q878:
The SetFileTime() API allows setting time for which of the following file timestamps?
A. Created, accessed, modified
B. Created only
C. Accessed only
D. Modified only
Correct Answer: A
Chapter: 39
Q879:
GetSystemTimeAsFileTime() returns time in ________.
A. FILETIME format
B. SYSTEMTIME format
C. TIMESTAMP format
D. DATE format
Correct Answer: A
Chapter: 39
Q880:
Which function converts system time to file time?
A. SystemTimeToFileTime
B. FileTimeToSystemTime
C. GetSystemTimeAsFileTime
D. SetFileTime
Correct Answer: C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now