login about faq

I want to make file permission format like '-rw-r-----'

but get_Permission() return type is integer.

I looked up the function on the chilkat site

but I don't know what to do.

I want to compare get_Permission return value and the octal value as below.

Please let me know.

========================================================================================== The 'permissions' field contains a bit mask specifying file permissions. These permissions correspond to the st_mode field of the stat structure defined by POSIX [IEEE.1003-1.1996].

This protocol uses the following values for the symbols declared in the POSIX standard.

   S_IRUSR  0000400 (octal)
   S_IWUSR  0000200
   S_IXUSR  0000100
   S_IRGRP  0000040
   S_IWGRP  0000020
   S_IXGRP  0000010
   S_IROTH  0000004
   S_IWOTH  0000002
   S_IXOTH  0000001
   S_ISUID  0004000
   S_ISGID  0002000
   S_ISVTX  0001000

================================================================================================

asked Aug 19 '13 at 05:23

hpmovie's gravatar image

hpmovie
112

edited Aug 19 '13 at 05:26


I don't understand the problem. Yes, it returns an integer as it should. An integer is an integer. An integer value can be represented in string form in many different number bases: binary, octal, decimal, hexidecimal, etc. When you see "S_IRUSR 0000400 (octal)" it's simply the octal representation of the integer. For example "0000400" octal is equal to 4*8^2 in decimal.

link

answered Aug 19 '13 at 12:23

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1

Asked: Aug 19 '13 at 05:23

Seen: 591 times

Last updated: Aug 19 '13 at 12:23

Related questions

powered by OSQA