File Access

File Access

ID: uniflow.plugin.fileaccess Category: Storage & Connectivity Version: v1.3.0 Min Uniflow Version: Uniflow ≥ v1.4.0

File Access Plugin Reference Manual

1. Overview

Plugin Name: File Access

Type: Storage

Identifier: uniflow.plugin.fileaccess

Description

A source plugin that monitors observable folders and allows reading/writing byte arrays and text files dynamically.


2. Technical Architecture

The File Access plugin manages local and network file system monitoring and file operations. It uses underlying operating system filesystem change notifications (FileSystemWatcher) for event-driven detection of file creation, modification, and deletion, while offering atomic read, write, append, and delete actions for text, CSV, JSON, and binary file formats.

System Interaction & Exposed Catalog Routes

The File Access plugin monitors local directories and SMB/NFS network shares. It uses FileSystemWatcher to emit events on file creation, modification, or deletion, while providing read/write capabilities for Text, CSV, and JSON files.

Catalog Routes & Node Integration

Input Event Triggers (Input Nodes):

  • file.created - Fired when a new file is detected in watched directory.
  • file.modified - Fired on file modification events.
  • file.deleted - Fired when a file is removed.
  • file.content_read - Emitted upon manual file read operation.
  • Executable Actions (Action Nodes):

  • file.write_text - Writes or overwrites a text/JSON file.
  • file.append_line - Appends data lines to a log or CSV file.
  • file.move - Moves or renames a file.
  • file.delete - Deletes a specified file.
  • Architecture Diagram

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...

    3. Configuration Parameters

    The following configuration fields are available in the User Interface for this plugin:

    Configuration SettingDescription
    Friendly NameSpecifies the friendly name.
    Description / NotesSpecifies the description / notes.

    4. Exposed Routes & Data Types

    This plugin exposes catalog fields across the following rule graph nodes:

    Event Input

    The Event Input node listens for real-time filesystem events in monitored local folders.

    Human-Readable Field NameData TypeExposed Event Fields & Data TypesDescription
    File Event  Event Object
    Name (String)
    Extension (String)
    Size (Int32)
    Directory (String)
    FullPath (String)
    LastWriteTime (DateTime)
    CreationTime (DateTime)
    ChangeType (String)
    Real-time event triggered when a file is created, modified, deleted, or renamed in monitored directories.

    Data Source

    The Data Source node queries directory file listings on local drives.

    Human-Readable Collection NameData TypeExposed Fields & Data TypesDescription
    Monitored Directory Files  Json` (`collection`)
    Name (String)
    Extension (String)
    Size (Int32)
    Directory (String)
    FullPath (String)
    LastWriteTime (DateTime)
    CreationTime (DateTime)
    List of file entry objects in monitored local folder.

    Output Target

    The Output Target node acts as an action sink node to write, append, delete, or move files on local disk.

    Target NameData TypeAssociated ParametersParameter Data TypeRequiredDescription
    Write File  Json
    File Path (path)StringTrueDestination file path on disk.
    Data Type (format)StringTrueFormat (String or Bytes).
    Operation (operation)StringTrueWrite mode (Overwrite or Append).
    Value (content)StringTrueContent text or byte string payload to write.
    Delete File  Json
    File Path (path)StringTrueFile path to delete from disk.
    Copy / Move File  Json
    Source Path (sourcePath)StringTrueSource file path.
    Destination Path (destinationPath)StringTrueTarget file destination path.
    Mode (mode)StringTrueFile operation type (Copy or Move).

    5. Usage Examples

    Scenario A: Local Hot-Folder CSV File Creation Parses Telemetry into Modbus Registers

    Workflow Overview:

    When a local ERP system drops a CSV batch file into C:\Uniflow\HotFolder\ (file.created with FullPath), Uniflow intercepts the filesystem event, parses the target batch size value, and writes it to a Modbus TCP holding register (HoldingRegister 50 = BatchSize), then moves the processed CSV to C:\Uniflow\Archive\.

    Rule Node Configuration:

    1. Event Input Node: File Access Listener

  • Filter Event: file.created
  • Exposed Fields: FullPath (String), Name (String), Extension (String)
  • 2. Logic Filter Node: Regex Match & Equal

  • Expression: Extension == ".csv"
  • 3. Output Target Node A: Modbus Client Writer

  • Action Target: Direct Access
  • Type: Holding Register
  • Address: 50
  • Value: Extracted batch size
  • 4. Output Target Node B: File Access Action

  • Action Target: Copy / Move File (file.move)
  • Source Path: FullPath
  • Destination Path: C:\Uniflow\Archive\${Name}
  • Mode: Move
  • Logic Flow Diagram:

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...

    Scenario B: Avigilon ACC Analytics Alarm Appends Incident Entry to Audit Log CSV

    Workflow Overview:

    When Avigilon ACC emits an analytics rule match event (ANALYTICS_RULE_MATCH), Uniflow formats a CSV log line ("{Timestamp},{CameraName},${RuleName}\n") and appends it (file.append_line) to the local audit log file C:\Uniflow\Logs\incidents.csv.

    Rule Node Configuration:

    1. Event Input Node: Avigilon ACC Listener

  • Event Code: ANALYTICS_RULE_MATCH
  • Exposed Fields: CameraName (String), RuleName (String), Timestamp (DateTime)
  • 2. Logic Formatter Node: CSV Line Builder

  • Template: "{Timestamp},{CameraName},${RuleName}"
  • 3. Output Target Node: File Access Writer

  • Action Target: Write File (file.append_line)
  • File Path: C:\Uniflow\Logs\incidents.csv
  • Operation: Append
  • Value: Formatted CSV string
  • Logic Flow Diagram:

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...
    Architecture Flow Diagram — Full Preview