FILEINFO Data Type

Describes a particular file by providing its attributes. 4Test defines this record data type as follows:

[-] type FILEINFO is record
	[ ] string sName
	[ ] boolean bIsDir
	[ ] number iSize
	[ ] integer iAttributes
	[ ] datetime dtLastModifyTime
	[ ] datetime dtCreationTime
Where:
  • sName is a string specifying the file name.
  • bIsDir is a boolean indicating whether the file is a true file or a directory.
  • iSize is an number specifying the file’s size.
  • iAttributes is an integer specifying the attributes of the file.
  • dtLastModifyTime is of the datetime data type and specifies the date and time that the file was last modified.
  • dtCreationTime is of the datetime data type and specifies the date and time that the file was created.

Attributes

The file attributes that you can determine with FILEINFO are:
  • FILE_ATTRIBUTE_ARCHIVE
  • FILE_ATTRIBUTE_COMPRESSED
  • FILE_ATTRIBUTE_DIRECTORY
  • FILE_ATTRIBUTE_ENCRYPTED
  • FILE_ATTRIBUTE_HIDDEN
  • FILE_ATTRIBUTE_NORMAL
  • FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
  • FILE_ATTRIBUTE_OFFLINE
  • FILE_ATTRIBUTE_READONLY
  • FILE_ATTRIBUTE_REPARSE_POINT
  • FILE_ATTRIBUTE_SPARSE_FILE
  • FILE_ATTRIBUTE_SYSTEM
  • FILE_ATTRIBUTE_TEMPORARY

To determine a file attribute, you must use a binary AND comparison with the file attribute. If the comparison returns that same file attribute, then the attribute exists.