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

%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 (Including Private)

Method Inventory (Including Private)

Parameters

parameter FILEEXT = stream;
parameter OPENAPPEND = AWUK\RAW\;
parameter OPENREAD = RUK\RAW\;
parameter OPENREADTERM = RSK\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;

Properties (Including Private)

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 CurrFile as %String (MAXLEN = 5000) [ Private , Transient ];
Full path name of currently opened file. Equal to "" if no file is open.
Property methods: CurrFileDisplayToLogical(), CurrFileGet(), CurrFileIsValid(), CurrFileLogicalToDisplay(), CurrFileLogicalToOdbc(), CurrFileNormalize(), CurrFileSet()
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 MakePermLoc as %Boolean [ Private , InitialExpression = 0 ];
If true then when saving this file we need to move it to the default permanent location
Property methods: MakePermLocDisplayToLogical(), MakePermLocGet(), MakePermLocIsValid(), MakePermLocLogicalToDisplay(), MakePermLocNormalize(), MakePermLocSet()
property NormalizedDirectory as %String (MAXLEN = 5000) [ Private ];
Normalized form of the directory. This is used for access to the file (as it adds the extra '/' if needed), but it stores the Directory in the Id as this may be a relative path. This is read only, you should not try and set its value.
Property methods: NormalizedDirectoryDisplayToLogical(), NormalizedDirectoryGet(), NormalizedDirectoryIsValid(), NormalizedDirectoryLogicalToDisplay(), NormalizedDirectoryLogicalToOdbc(), NormalizedDirectoryNormalize(), NormalizedDirectorySet()
property ReadMode as %Integer [ Private , InitialExpression = ..#READNORMAL ];
Mode the device is opened in, either with terminators as delimitors or not.
Property methods: ReadModeDisplayToLogical(), ReadModeGet(), ReadModeIsValid(), ReadModeLogicalToDisplay(), ReadModeNormalize(), ReadModeSet()
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 StoreFile as %String (MAXLEN = 5000) [ Private ];