The Unix File Attributes packet consists of the following:
File-Index Type Filename@File-Attributes@Link @Extended-Attributes@ where
#define FT_LNKSAVED 1 /* hard link to file already saved */ #define FT_REGE 2 /* Regular file but empty */ #define FT_REG 3 /* Regular file */ #define FT_LNK 4 /* Soft Link */ #define FT_DIR 5 /* Directory */ #define FT_SPEC 6 /* Special file -- chr, blk, fifo, sock */ #define FT_NOACCESS 7 /* Not able to access */ #define FT_NOFOLLOW 8 /* Could not follow link */ #define FT_NOSTAT 9 /* Could not stat file */ #define FT_NOCHG 10 /* Incremental option, file not changed */ #define FT_DIRNOCHG 11 /* Incremental option, directory not changed */ #define FT_ISARCH 12 /* Trying to save archive file */ #define FT_NORECURSE 13 /* No recursion into directory */ #define FT_NOFSCHG 14 /* Different file system, prohibited */ #define FT_NOOPEN 15 /* Could not open directory */ #define FT_RAW 16 /* Raw block device */ #define FT_FIFO 17 /* Raw fifo device */
The File-attributes consist of the following:
Field No. | Stat Name | Unix | Win98/NT | MacOS |
1 | st_dev | Device number of filesystem | Drive number | vRefNum |
2 | st_ino | Inode number | Always 0 | fileID/dirID |
3 | st_mode | File mode | File mode | 777 dirs/apps; 666 docs; 444 locked docs |
4 | st_nlink | Number of links to the file | Number of link (only on NTFS) | Always 1 |
5 | st_uid | Owner ID | Always 0 | Always 0 |
6 | st_gid | Group ID | Always 0 | Always 0 |
7 | st_rdev | Device ID for special files | Drive No. | Always 0 |
8 | st_size | File size in bytes | File size in bytes | Data fork file size in bytes |
9 | st_blksize | Preferred block size | Always 0 | Preferred block size |
10 | st_blocks | Number of blocks allocated | Always 0 | Number of blocks allocated |
11 | st_atime | Last access time since epoch | Last access time since epoch | Last access time -66 years |
12 | st_mtime | Last modify time since epoch | Last modify time since epoch | Last access time -66 years |
13 | st_ctime | Inode change time since epoch | File create time since epoch | File create time -66 years |
Kern Sibbald 2010-08-30