Purchase Solution

how to convert a octal value for UNIX file permissions to a text value

Not what you're looking for?

Ask Custom Question

Can anyone explain to me 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

I have found this information but still can not figure out the conversion.

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

Purchase this Solution

Solution Summary

This job explores how to convert a octal value for UNIX file permissions to a text value.

Solution Preview

The chart you have given only shows how the octal system is interpreted in binary. This is not the octal system that is practically used in unix.
For this you need to know about Octal permissions in Unix as follows:

Octal Permissions

Unix systems use octal (base-8) numbers to specify the various permission bits. These correspond to human-readable permissions as follows:
Octal Number Human-Readable Letter
4 read r
2 write w
1 execute x
0 none

These permissions are additive?that is, by adding up the numbers corresponding to the permissions that you want to grant, ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic Networking Questions

This quiz consists of some basic networking questions.