Enter a mask:
Result:
All Flags:
What is it for?
This calculator is for decoding the st_mode mask to a human-readable format. It will be probably be useless to 99.99999% of people. The st_mode flags are defined here: include/uapi/linux/stat.h They are used to define file type and file permissions. It is used (as far as I know) when you read the attributes of a file, and when a new file is created. When you read the attributes of a file a struct stat is returned. This struct contains st_mode.struct stat { dev_t st_dev; /* ID of device containing file */ ino_t st_ino; /* inode number */ mode_t st_mode; /* protection */ ....
fstat(3, {st_mode=S_IFREG|0644, st_size=5699248, ...}) = 0
int open(const char *pathname, int flags, mode_t mode); int creat(const char *pathname, mode_t mode); int openat(int dirfd, const char *pathname, int flags, mode_t mode);
int fd = open("/tmp/test.txt", O_RDWR|O_CREAT); // it becomes this (or something similiar) in kernel space int ret = sys_open(path, flags, mode); //which becomes something like when open calls are traced: test_me-2737 [000] .... 3556.552147: test_probe: (do_sys_open+0x0/0x290) dfd=0xffffffff986daf80 filename="supervise/status.new" flags=0x1ed mode=0xc0273f48ffffffff