ITPEC FE Subject A April 2024 Question 33

In an OS where permissions for reading, writing, or executing a file can be independently set as attributes of the file, one bit is allocated for each of these three (3) permissions to determine whether they are allowed or not. When these three bits are configured using an octal value from 0 through 7, the trial results below are obtained. Which of the following is an appropriate trial result?

[Trial results]

(1)When 0 is set, reading, writing, and execution can no longer be performed.(2)When 3 is set, reading and writing can be performed, but execution cannot.(3)When 7 is set, reading, writing, and execution can be performed.

Explanation

When 4 is set, only execution can be performed — the trials show that the bit worth 4 is execute.

Write each octal digit as three bits worth 4, 2 and 1.

  • •3 is 011 and allows reading and writing but not execution, so the bits worth 2 and 1 are read and write, and the bit worth 4 is execute
  • •0 is 000 (nothing) and 7 is 111 (everything), consistent with this
  • •4 is 100: only the execute bit is on, so only execution is possible

The trials do not tell which of read and write is worth 1 and which is worth 2, but no option depends on that.

Answer (b)

Why not others:

  • •(a) — 2 is 010: only one of the two low bits, so reading or writing alone, and never execution
  • •(c) — 5 is 101: the execute bit plus one of read and write, so execution is always allowed, not writing only
  • •(d) — 6 is 110: the execute bit plus one of read and write; reading and writing together without execution is 3, not 6

Key rule: Derive each bit's meaning from the given facts before decoding other values, rather than assuming the familiar Unix order where read is 4 and execute is 1.

Basic Theory · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.