Skip to content

Instantly share code, notes, and snippets.

@andypost
Created January 14, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andypost/2a2a9fb43e60f3556c39 to your computer and use it in GitHub Desktop.
Save andypost/2a2a9fb43e60f3556c39 to your computer and use it in GitHub Desktop.
The following flags are defined for the st_mode field:
S_IFMT 0170000 bit mask for the file type bit fields
S_IFSOCK 0140000 socket
S_IFLNK 0120000 symbolic link
S_IFREG 0100000 regular file
S_IFBLK 0060000 block device
S_IFDIR 0040000 directory
S_IFCHR 0020000 character device
S_IFIFO 0010000 FIFO
S_ISUID 0004000 set-user-ID bit
S_ISGID 0002000 set-group-ID bit (see below)
S_ISVTX 0001000 sticky bit (see below)
@andypost
Copy link
Author

man fstat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment