Convert a octal value for unix file permissions to value


Discuss the below:

Q: Explain how to convert a octal value for UNIX file permissions to a text value to display on screen. For example I need to write code in C++ that would take in octal value 100666 and display rw-rw-rw

Octal digit Text equivalent Binary value Meaning

0 --- 000 All types of access are denied

1 --x 001 Execute access is allowed only

2 -w- 010 Write access is allowed only

3 -wx 011 Write and execute access are allowed

4 r-- 100 Read access is allowed only

5 r-x 101 Read and execute access are allowed

6 rw- 110 Read and write access are allowed

7 rwx 111 Everything is allowed

 

Solution Preview :

Prepared by a verified Expert
Programming Languages: Convert a octal value for unix file permissions to value
Reference No:- TGS01937704

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)