38.0k views
3 votes
A user with a umask of 0534 attempts to create a file with the call:

open("examfile", O RDWR | O CREAT, S RWXU | S IRGRP | S IXGRP | S IXOTH);
(a) Assuming that examfile does not exist, what will permissions of the created file be? (show your
work)

User Momeara
by
8.7k points

1 Answer

5 votes

Final answer:

The final permissions for the file 'examfile' created by a user with a umask of 0534 will be ---r-----x, which corresponds to 0401 in octal form.

Step-by-step explanation:

When a user attempts to create a file in a Unix-like system, the system checks the umask to determine the file permissions that should be set. The umask acts as a set of permissions that the system will not set when a new file or directory is created. To determine the permissions of the newly created file, one has to subtract the umask from the default permissions.

The default permission for a file is 0666, which allows read and write access for the user, group, and others. The umask of 0534 is applied as follows:





Therefore, the final permissions for the file 'examfile' are ---r-----x or 0401 in octal form.

User Hemant Sharma
by
8.7k points