CS FundamentalsModerateGATE CS · Amazon/Microsoft SDE MCQ

A process with umask 027 creates a regular file requesting mode 0666 and a directory requesting mode 0777. What permissions do they get?

  1. A. 0640 and 0750
  2. B. 0644 and 0755
  3. C. 0640 and 0751
  4. D. 0646 and 0757

Correct answer: A. 0640 and 0750

The umask bits are cleared: 0666 & ~027 = 0640 (rw-r-----) and 0777 & ~027 = 0750 (rwxr-x---). The umask is masked out, not subtracted digit by digit, though here both give the same.

More Operating Systems questions

Exams that ask this topic