www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - getAttributes

reply nix <nix_member pathlink.com> writes:
Hello, 

writefln("File attribute %d ",getAttributes("hello")); 

the result is: 
File attribute 33279 

-rwxrwxrwx  1 nix nix 312209 2005-03-21 10:19 hello 

May someone explain me what the 33279 means. 


chmod 700 hello  then i get a new File attribute: 
File attribute 33216 

It is a Linux Client. 
Mar 21 2005
next sibling parent reply AEon <AEon_member pathlink.com> writes:
Hello, 

writefln("File attribute %d ",getAttributes("hello")); 

the result is: 
File attribute 33279 

-rwxrwxrwx  1 nix nix 312209 2005-03-21 10:19 hello 

May someone explain me what the 33279 means. 


chmod 700 hello  then i get a new File attribute: 
File attribute 33216 

It is a Linux Client. 

From the manual: uint getAttributes(char[] name) Get file name[] attributes. My is you are converting a uint to int and that this is causing problems. writefln("File attribute ",getAttributes("hello")); might work better, i.e. letting writefln() do the right thing, type-wise. AEon
Mar 21 2005
parent nix <nix_member pathlink.com> writes:
Oh, my writefln statement is wrong: 

writefln("File attribute %d",getAttributes("hello")); 
^ 

I forgot %d , but the result is the same. 

In article <d1mji2$30j2$1 digitaldaemon.com>, AEon says... 
 
Hello,  
 
writefln("File attribute %d ",getAttributes("hello"));  
 
the result is:  
File attribute 33279  
 
-rwxrwxrwx  1 nix nix 312209 2005-03-21 10:19 hello  
 
May someone explain me what the 33279 means.  
 
 
chmod 700 hello  then i get a new File attribute:  
File attribute 33216  
 
It is a Linux Client.  

From the manual: uint getAttributes(char[] name) Get file name[] attributes. My is you are converting a uint to int and that this is causing problems. writefln("File attribute ",getAttributes("hello")); might work better, i.e. letting writefln() do the right thing, type-wise. AEon

Mar 21 2005
prev sibling parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
"nix" <nix_member pathlink.com> wrote in message 
news:d1mj52$304e$1 digitaldaemon.com...
 Hello,

 writefln("File attribute %d ",getAttributes("hello"));

 the result is:
 File attribute 33279

try printing in octal %o instead of %d to see if that explains the numbers.
Mar 21 2005
parent nix <nix_member pathlink.com> writes:
Yes octal is much better. Thanks 

Here is how i interpret the numbers. 

/dev/xdb3 60660      brw-rw----   first 6 show it is a block device (b) 
/dev/video56 20660   crw-rw----   2 show a character device (c) 
hello 104777         -rwsrwxrwx   4 is the sticky bit (s); 1 is a file 
/sys 40755           drwxr-xr-x   4 show it is a directory 
hello.d 100644       -rw-r--r--   1 is a normal file 
/tmp 41777           drwxrwxrwt   4 is directory and t must be the 1 
gdm_socket 140666   srw-rw-rw-   1 is a file and 4 is a socket 
/dev/cdrom 60660     lrwxrwxrwx   Ops that's a problem... , ah, that is 
a symlink to  /dev/hdc with  brw-rw----  .  


In article <d1mpo0$5es$1 digitaldaemon.com>, Ben Hinkle says... 
 
 
"nix" <nix_member pathlink.com> wrote in message  
news:d1mj52$304e$1 digitaldaemon.com... 
 Hello, 
 
 writefln("File attribute %d ",getAttributes("hello")); 
 
 the result is: 
 File attribute 33279 

try printing in octal %o instead of %d to see if that explains the numbers.

Mar 21 2005