Interviewer And Interviewee Guide

Linux OS Management Interview Question:

Given a code snippet below?

#define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
int main() {
int fd1, fd2;
umask(0);
fd1 = open("file1", O_CREAT | O_RDWR, PERMS)
umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
fd2 = open("file2", O_CREAT | O_RDWR, PERMS)
return 0;
}

The newly created files file1 and file2 will have the permissions respectively
a) rw-rw-rw- r---
b) r--- rw-rw-rw-
c) rw-rw-rw- rw---
d) None of the above

Submitted by: Murtaza
c) rw-rw-rw- rw---
Submitted by: Murtaza

Read Online Linux OS Management Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.