•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileFattrib()
Fxattr()                                                             GEMDOS

Syntax

LONG Fxattr( flag, name, xattr )
WORD flag;
char *name;
XATTR *xattr;

Function      Fxattr() returns extended information about the specified
              file.

Opcode        300 (0x12C)

Availability  Available when a 'MiNT' cookie with a version of at least
              0.90 exists.

Parameters    flag specifies whether attributes returned by this call on
              symbolic links should be those of the file to which the link
              points or the link itself. A value of FX_FILE (0) causes the
              attributes to be those of the actual file whereas a value of
              FX_LINK (1) returns the attributes of the link itself. name
              specifies the name of the file from which attributes are to
              be read and placed in the XATTR structure pointed to by
              xattr. XATTR is defined as follows:

              typedef struct
              {
               UWORD mode;
               LONG index;
               UWORD dev;
               UWORD reserved1;
               UWORD nlink;
               UWORD uid;
               UWORD gid;
               LONG size;
               LONG blksize;
               LONG nblocks;
               WORD mtime;
               WORD mdate;
               WORD atime;
               WORD adate;
               WORD ctime;
               WORD cdate;
               WORD attr;
               WORD reserved2;
               LONG reserved3;
               LONG reserved4;
              } XATTR;

              XATTR's members have the following meaning:

              XATTR Element  Meaning

              mode           Masking mode with 0170000 (0xF000) reveals the
                             file type as one of the following:

                             S_IFSOCK (0010000) ... octal
                             S_IFCHR  (0020000)
                             S_IFDIR  (0040000)
                             S_IFBLK  (0060000)
                             S_IFREG  (0100000)
                             S_IFIFO  (0120000)
                             S_IMEM   (0140000)
                             S_IFLNK  (0160000)

                             The lower three nibbles of mode is a bit mask
                             which specifies the legal file access mode(s)
                             as defined in Fchmod().

              index          This member combined with the dev field are
                             designed to provide a unique identifier for
                             a file under file systems which allow
                             multiple files with the same filename.

              dev            This value represents either a BIOS device
                             number or an identifier created by the file
                             system to represent a remote device.

              reserved1      This structure element is currently reserved
                             for future implementations of MiNT.

              nlink          This value specifies the current number of
                             hard links attached to the file. On a file
                             system that does not support hard links and
                             for most regular files, nlink is 1.

              uid            uid is the user ID of the owner of the file.

              gid            gid is the group ID of the owner of the file.

              size           size is the length of the file in bytes.

              blksize        blksize specifies the size of blocks (in
                             bytes) in this file system.

              nblocks        nblocks is the actual number of blocks the
                             file is using on the device. This number may
                             include data storage elements other used to
                             keep track of the file (aside from the actual
                             data).

              mtime, mdate   Time and date of the last file modification
                             in GEMDOS format.

              atime, adate   Time and date of the last file access in
                             GEMDOS format.

              ctime, cdate   Time and date of the file's creation in
                             GEMDOS format.

              attr           Standard file attributes (same as read by
                             Fattrib() ).

              reserved2      This structure element is currently reserved
                             for future implementations of MiNT.

              reserved3      This structure element is currently reserved
                             for future implementations of MiNT.

              reserved4      This structure element is currently reserved
                             for future implementations of MiNT.

Binding       pea      xattr
              pea      name
              move.w   flag,-(sp)
              move.w   #$12C,-(sp)
              trap     #1
              lea      12(sp),sp

Return Value  Fxattr() returns 0 if successful or a negative GEMDOS error
              code otherwise.

See Also      Fattrib()