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: Murtazac) rw-rw-rw- rw---
Submitted by: Murtaza
Submitted by: Murtaza
Read Online Linux OS Management Job Interview Questions And Answers
Top Linux OS Management Questions
☺ | Which option of rmdir command will remove all directories a, b, c if path is a/b/c: |
☺ | Which of the following time stamps need not exist for a file on traditional unix file system: |
☺ | When mv f1 f2 is executed which file\'s inode is freed? |
☺ | What is the default maximum number of processes that can exist in Linux? |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |