Skip to main content

Inventory.FileComponent

Class Inventory.FileComponent Extends (Component, Hashable) [ Inheritance = right ]

FileComponent is a subclass of Component. An instance represents an operating system file.

It contains properties representing the file's name, last modified date, size, and a SHA1 hash of the file's contents.

Parameters

XMLNAME

Parameter XMLNAME = "FileComponent";

The element name used in the XML representation of the component.

XMLTYPE

Parameter XMLTYPE = "FileComponent";

The identifier used to distinguish the type of this component in the XML representation.

Properties

DateModified

Property DateModified As %TimeStamp;

The last modified date of of the file referenced by this FileComponent.

Filename

Property Filename As %String(MAXLEN = 256) [ Required ];

The unqualified filename, i.e., without its directory component, of the file referenced by this FileComponent.

Size

Property Size As %Integer;

The size, in bytes, of the file referenced by this FileComponent.

Methods

Init

Method Init(scan As Scan, fileName As %String) As FileComponent

Initializes and saves this FileComponent, recording scan as the Scan property, and scanning fileName for its size, last modified date, and SHA1 hash.

The saved FileComponent is returned.