typedef WordFlags FileDate; #define FD_YEAR 0xfe00 #define FD_MONTH 0x01e0 #define FD_DAY 0x001f #define FD_YEAR_OFFSET 9 #define FD_MONTH_OFFSET 5 #define FD_DAY_OFFSET 0
A file's date stamp is stored in a 16-bit bitfield. This field contains entries for the year, month, and day.
Each field is identified by a mask and an offset. To access a field, simply clear all bits except those in the mask, then shift the bits to the right by the number of the offset. (Macros are provided to do this; they are described below.) FileDate
contains the
following fields, identified by their masks:
FD_YEAR_OFFSET
bits.FD_MONTH_OFFSET
bits.FD_DAY_OFFSET
bits.Include: file.h
See Also: FileTime
typedef DWordFlags FileDateAndTime; #define FDAT_HOUR 0xf8000000 #define FDAT_MINUTE 0x07e00000 #define FDAT_2SECOND 0x001f0000 #define FDAT_YEAR 0x0000fe00 #define FDAT_MONTH 0x000001e0 #define FDAT_DAY 0x0000001f #define FDAT_HOUR_OFFSET 27 #define FDAT_MINUTE_OFFSET 21 #define FDAT_2SECOND_OFFSET 16 #define FDAT_YEAR_OFFSET 9 #define FDAT_MONTH_OFFSET 5 #define FDAT_DAY_OFFSET 0 #define FDAT_BASE_YEAR 1980
Every GEOS file has two date and time stamps. One of them records the time the file was created, and one records the time the file was last modified. These stamps are recorded with the file's extended attributes; they are labeled FEA_CREATION and FEA_MODIFICATION, respectively. Non-GEOS files have a single date/time stamp, which records the time the file was last modified.
The date/time stamps are stored in a 32-bit bitfield. This field contains entries for the year, month, day, hour, minute, and second. Each field is identified by a mask and an offset. To access a field, simply clear all bits except those in the mask, then shift the bits to the right by the number of the offset. (Macros are provided to do this; they are described below.)
FileDateAndTime
contains the following fields, identified by their masks:
Macros are provided to extract values from each of the fields of a
FileDateAndTime
structure. The macros are listed below:
byte FDATExtractYear( /* returns year field, counted from 1980*/ FileDateAndTime fdat); word FDATExtractYearAD( /* returns year field + base year */ FileDateAndTime fdat); byte FDATExtractMonth( /* returns month field (1 = January, etc.) */ FileDateAndTime fdat); byte FDATExtractDay( /* returns day field */ FileDateAndTime fdat); byte FDATExtractHour( /* returns hour field */ FileDateAndTime fdat); byte FDATExtractMinute( /* returns minute field */ FileDateAndTime fdat); byte FDATExtract2Second( /* returns 2Second field */ FileDateAndTime fdat); byte FDATExtractSecond( /* returns number of seconds (2 * 2Second) */ FileDateAndTime fdat);
Include: file.h
typedef ByteEnum FileExclude; #define FE_EXCLUSIVE 1 #define FE_DENY_WRITE 2 #define FE_DENY_READ 3 #define FE_NONE 4
typedef struct { FileExtendedAttribute FEAD_attr; /* Attribute to get or set */ void *FEAD_value; /* Pointer to buffer/new value */ word FEAD_size; /* length of buffer/new value */ chr *FEAD_name; /* If FEAD_attr == FEA_CUSTOM, * this points to null- * terminated ASCII string with * attribute's name; otherwise, * this is ignored. */
} FileExtendedAttrDesc;
The routines to get and set extended attributes can be passed the attribute FEA_MULTIPLE. In this case, they will also be passed the address of an array of
FileExtAttrDesc
structures and the number of elements of the array. They will go through the array and read or write the appropriate information.
FileEnum()
can also be passed arrays of
FileExtAttrDesc
structures. In this case, the number of elements in the array is not passed. Instead, each array ends with a
FileExtAttrDesc
with a FEAD
_attr
field set to FEA_END_OF_LIST.
See Also: FileExtendedAttribute
.
Include: file.h
typedef enum /* word */ { FEA_MODIFICATION, FEA_FILE_ATTR, FEA_SIZE, FEA_FILE_TYPE, FEA_FLAGS, FEA_RELEASE, FEA_PROTOCOL, FEA_TOKEN, FEA_CREATOR, FEA_USER_NOTES, FEA_NOTICE, FEA_CREATION, FEA_PASSWORD, FEA_CUSTOM, FEA_NAME, FEA_GEODE_ATTR, FEA_PATH_INFO, FEA_FILE_ID, FEA_DESKTOP_INFO, FEA_DRIVE_STATUS, FEA_DOS_NAME, FEA_OWNER, FEA_RIGHTS, FEA_MULTIPLE = 0xfffe, FEA_END_OF_LIST = 0xffff, } FileExtendedAttribute;
Every GEOS file has a set of extended attributes. These attributes can be recovered with
FileGetPathExtAttributes()
or
FileGetHandleExtAttributes()
. You can also use
FileEnum()
to search a directory for files with specified extended attributes.
The above extended attributes have been implemented. More may be added with future releases of GEOS. The attributes are discussed at length in the File System chapter.
See Also: FileExtAttrDesc
.
Include: file.h