Term: termphp converts the result returned by the fileterms function into a readable form: Copy the code as follows: functionperms_str ($ perms) {if ($ perms & 0xC000) 0xC000) {Socket $ infos ;} elseif ($ perms & 0xA000) 0xA000) {SymbolicLink $ info
The code is as follows:
Function perms_str ($ perms ){
If ($ perms & 0xC000) = 0xC000 ){
// Socket
$ Info ='s ';
} Elseif ($ perms & 0xA000) = 0xA000 ){
// Symbolic Link
$ Info = 'l ';
} Elseif ($ perms & 0x8000) = 0x8000 ){
// Regular
$ Info = '-';
} Elseif ($ perms & 0x6000) = 0x6000 ){
// Block special
$ Info = 'B ';
} Elseif ($ perms & 0x4000) = 0x4000 ){
// Directory
$ Info = 'd ';
} Elseif ($ perms & 0x2000) = 0x2000 ){
// Character special
$ Info = 'C ';
} Elseif ($ perms & 0x1000) = 0x1000 ){
// FIFO pipe
$ Info = 'p ';
} Else {
// Unknown
$ Info = 'u ';
}
// Owner
$ Info. = ($ perms & 0x0100 )? 'R ':'-');
$ Info. = ($ perms & 0x0080 )? 'W ':'-');
$ Info. = ($ perms & 0x0040 )?
($ Perms & 0x0800 )? 'S ': 'X '):
($ Perms & 0x0800 )? 'S ':'-'));
// Group
$ Info. = ($ perms & 0x0020 )? 'R ':'-');
$ Info. = ($ perms & 0x0010 )? 'W ':'-');
$ Info. = ($ perms & 0x0008 )?
($ Perms & 0x0400 )? 'S ': 'X '):
($ Perms & 0x0400 )? 'S ':'-'));
// World
$ Info. = ($ perms & 0x0004 )? 'R ':'-');
$ Info. = ($ perms & 0x0002 )? 'W ':'-');
$ Info. = ($ perms & 0x0001 )?
($ Perms & 0x0200 )? 'T': 'X '):
($ Perms & 0x0200 )? 'T ':'-'));
Return $ info;
}
The above describes how term php converts the results returned by the fileterms function into readable forms, including the term content, and hopes to help those who are interested in the PHP Tutorial.