And so on. If you bitwise AND these definitions against that 6-digit octal number (st_mode), you'll see how the -X file tests work in Perl.#define __S_IFMT 0170000 /* These bits determine file type. */ /* File types. */ #define __S_IFDIR 0040000 /* Directory. */ #define __S_IFCHR 0020000 /* Character device. */ #define __S_IFBLK 0060000 /* Block device. */ #define __S_IFREG 0100000 /* Regular file. */ #define __S_IFIFO 0010000 /* FIFO. */
In reply to Re: Modes in perlfunc
by clintp
in thread Modes in perlfunc
by ChuckularOne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |