Skip to main content

LogFileRead

procedure LogFileRead(const aFilePath: string)

Example

procedure ScriptEvent(var Value: variant);
begin
// Call after your code has actually read the governed file.
LogFileRead('C:\VeloxData\Reference\customer-codes.csv');
end;

Usage

LogFileRead queues a Read file-audit record for a path in the current flow log without opening or verifying the file.

Parameters

NameTypeDescription
aFilePathstring, constLexical file path to record. Empty, relative, nonexistent and malformed path text is accepted unless path parsing itself raises.

Errors

Construction/parsing exceptions are caught by the helper, which adds an Error log item and returns nil; LogFileRead exposes no result. Later database-save failures are handled separately by the log subsystem. The procedure does not report an invalid/nonexistent file because it never checks one.

Additional Technical Info

LogFileRead queues a path-only file-audit item with native event fetRead. It is an assertion supplied by the script, not an I/O operation: Velox does not open the path, check that it exists or prove it was read.

Call it only after the relevant code has successfully completed the read you want the log to represent. The example is fictional and source-reviewed and did not access a file.

Implementation trace

  1. TvxScripter.LogFileRead calls CreateLogFileEventFromPath(aFilePath, fetRead) with the native Read value.
  2. The helper creates a TvxLogFile under the current log and copies its Test flag.
  3. ExtractFileName stores the rightmost filename component.
  4. ExtractFilePath stores the drive/directory text including its trailing separator.
  5. ExtractFileExt reads the final extension and Velox removes its leading dot.
  6. The event is set to native fetRead.

No bytes are read. FileHash, FileData, File Connection/Definition identifiers and transport identity remain empty.

Path semantics

Parsing is lexical and Windows-hosted. Velox does not:

  • resolve a relative path against a stable base;
  • normalize . or .. segments;
  • expand environment variables;
  • resolve links or canonical casing;
  • reject wildcards, directory-only text or alternate stream syntax; or
  • capture a stable file identity.

Record the exact governed path form your operational processes expect. Two different strings for the same physical file remain different audit entries.

Deferred persistence

The item exists only in the current flow log until that master log is saved. Persistence creates VX_LOG_FILE and VX_LOG_FILE_LINK rows. If the final log status is not configured for saving, no durable read record is produced.

Repeated calls are not deduplicated. A recorded Read event is not proof that content was read completely, successfully, once, or before a concurrent replacement.

Related entries

External references

Created 2026-07-15