Rixstep
 About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Home » Learning Curve » ACP Guru

The Eleventh Column

It's there if you want it.


Get It

Try It

Xfile already has ten columns of data - why add another?

Xfile culls data from the stat family of calls. There are some fields that are generally not that pertinent to file management and can be limited to the 'stat' sheet.

struct stat {
    dev_t           st_dev;           /* ID of device containing file */
    mode_t          st_mode;          /* Mode of file (see below) */
    nlink_t         st_nlink;         /* Number of hard links */
    ino_t           st_ino;           /* File serial number */
    uid_t           st_uid;           /* User ID of the file */
    gid_t           st_gid;           /* Group ID of the file */
    dev_t           st_rdev;          /* Device ID */
    struct timespec st_atimespec;     /* time of last access */
    struct timespec st_mtimespec;     /* time of last data modification */
    struct timespec st_ctimespec;     /* time of last status change */
    struct timespec st_birthtimespec; /* time of file creation(birth) */
    off_t           st_size;          /* file size, in bytes */
    blkcnt_t        st_blocks;        /* blocks allocated for file */
    blksize_t       st_blksize;       /* optimal blocksize for I/O */
    uint32_t        st_flags;         /* user defined flags for file */
    uint32_t        st_gen;           /* file generation number */
    int32_t         st_lspare;        /* RESERVED: DO NOT USE! */
    int64_t         st_qspare[2];     /* RESERVED: DO NOT USE! */
};

You can see 16 of the 18 fields below. Only st_lspare and st_qspare are left out (for obvious reasons).



The ten columns of data displayed up to now are the following.

    mode_t          st_mode;          /* Mode of file (see below) */
    nlink_t         st_nlink;         /* Number of hard links */
    ino_t           st_ino;           /* File serial number */
    uid_t           st_uid;           /* User ID of the file */
    gid_t           st_gid;           /* Group ID of the file */
    dev_t           st_rdev;          /* Device ID */
    struct timespec st_atimespec;     /* time of last access */
    struct timespec st_mtimespec;     /* time of last data modification */
    struct timespec st_ctimespec;     /* time of last status change */
    off_t           st_size;          /* file size, in bytes */

The one added is the following.

    uint32_t        st_flags;         /* user defined flags for file */

It's to the immediate left of the 'mode' column. Why add it?

The 'flags' field wasn't used much up to now. Displaying row after row of '00000000' is a bit redundant. And it's rather redundant even today. But starting with Mac OS X 10.6 Snow Leopard Apple are starting to use it more. The main reason is they've started compressing system files. You'll find these in all the standard 'Unix' directories: /bin, /private, /sbin, and /usr. Almost everything in those hives is compressed.

The flag shows up in the standard info sheet as '00000020'. But unlike other flags, it can't be set or reset programmatically. Which is a bit inconsistent but that's the way it is. The system reports back if the item is compressed; other access is needed to actually compress the file.

The eleventh column is actually 'mode' with the new release of Xfile; 'flags' is the tenth column immediately to its left. Drag the divider between 'modified' and 'mode' to the right to expose it.

The 'flags' field is of course used for other things as well. If your ordinary permissions don't seem to be doing what you expect, then the item's flags can be the reason.

Starting now you can activate 'BlueMode' to use an alternate colour in the 'mode' column if you don't want to see the 'flags' column all the time but still want to know when something's up. Once Apple users all update to 10.6 or better this will mostly be a thing of the past.

See Also
Xfile Test Drive

About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Copyright © Rixstep. All rights reserved.