Home > Class Reference > ENSLIB namespace > %Library.FileStreamAdaptor


abstract stream class %Library.FileStreamAdaptor extends %Library.AbstractStream

Stream adaptor for streams that store data in external files. Not to be used directly.

Property Inventory

Method Inventory


parameter FILEEXT = stream;
parameter OPENREAD = RUK\RAW\;
parameter OPENWRITE = WUNK\RAW\;
final parameter READLINE = 1;
final parameter READNORMAL = 0;
parameter STORAGE = OTHER;
final parameter WRITEAPPEND = 1;
final parameter WRITEJUSTSAVED = 4;
final parameter WRITENORMAL = 0;


property CanonicalFilename as %String (MAXLEN = 5000) [ Calculated ];
Read only property that returns the canonical filename if the file is open and "" if the file is not open. On VMS this will include the file version number
Property methods: CanonicalFilenameDisplayToLogical(), CanonicalFilenameGet(), CanonicalFilenameIsValid(), CanonicalFilenameLogicalToDisplay(), CanonicalFilenameLogicalToOdbc(), CanonicalFilenameNormalize()
property Directory as %String (MAXLEN = 5000);
Directory where stream files are located.
Property methods: DirectoryDisplayToLogical(), DirectoryGet(), DirectoryIsValid(), DirectoryLogicalToDisplay(), DirectoryLogicalToOdbc(), DirectoryNormalize(), DirectorySet()
property Filename as %String (MAXLEN = 5000) [ Calculated ];
The filename that this stream is currently using
Property methods: FilenameDisplayToLogical(), FilenameGet(), FilenameIsValid(), FilenameLogicalToDisplay(), FilenameLogicalToOdbc(), FilenameNormalize(), FilenameSet()
property LineTerminator as %String (MAXLEN = 10) [ InitialExpression = $get(^%SYS("Stream","LineTerminator"),$select($$$isUNIX:$char(10),1:$char(13,10))) , Transient ];
For file streams the line will terminate on any of the characters set in the LineTerminator, it does not support multi-character line terminators because it uses the Cache file behavior which terminates on any of the characters. Updating this in the middle of a file on VMS will rewind the file to the beginning because of the way files work on VMS.
Also for %FileCharacterStream even if you set this when you call WriteLine() as the file was opened in 'S' mode it will normalize the line terminator as the data is being written, so for example if you set LineTerminator to $char(13,10) on Unix systems when you call WriteLine() it will only write $char(10) to the file.
Property methods: LineTerminatorDisplayToLogical(), LineTerminatorGet(), LineTerminatorIsValid(), LineTerminatorLogicalToDisplay(), LineTerminatorLogicalToOdbc(), LineTerminatorNormalize(), LineTerminatorSet()
property ReadSize as %Integer;
While reading this holds the file size
Property methods: ReadSizeDisplayToLogical(), ReadSizeGet(), ReadSizeIsValid(), ReadSizeLogicalToDisplay(), ReadSizeNormalize(), ReadSizeSet()
property RemoveOnClose as %Boolean [ InitialExpression = 0 , Transient ];
If true then remove the permanent file as well as any temp file when this object is closed
Property methods: RemoveOnCloseDisplayToLogical(), RemoveOnCloseGet(), RemoveOnCloseIsValid(), RemoveOnCloseLogicalToDisplay(), RemoveOnCloseNormalize(), RemoveOnCloseSet()
property UseVMSVersion as %Boolean [ InitialExpression = 0 , Transient ];
If true then on VMS only do not delete the persistent file before replacing it with the new version. This will cause the new version to be written with a new version number and so will keep the old file version present.
Property methods: UseVMSVersionDisplayToLogical(), UseVMSVersionGet(), UseVMSVersionIsValid(), UseVMSVersionLogicalToDisplay(), UseVMSVersionNormalize(), UseVMSVersionSet()


classmethod %Exists(soid As %ObjectIdentity) as %Boolean
Inherited description: Checks to see if the object identified by the OID oid exists in the extent.

Returns %Boolean TRUE is it exists, FALSE if it does not.

method %LocationGet() as %String
method %LocationSet(value As %String) as %Status
method %NormalizeObject() as %Status
Inherited description: Normalizes all of an object's property values by invoking the data type Normalize methods. Many data types may allow many different representations of the same value. Normalization converts a value to its cannonical, or normalized, form.
classmethod %ObjectIsNull(soid As %ObjectIdentity) as %Boolean
Inherited description: Return true if this stream oid is a null stream and false if the stream is not null
method %ValidateObject(force As %Library.Integer = 0, checkserial As %Library.Boolean = 1) as %Status