Skip to content

Filesystem Operations

The simulated filesystem is a tree of UOperatingSystemDirectory and UOperatingSystemFile objects owned by UOperatingSystem. Paths differ by OS type:

OS typeExample path
UOperatingSystemNonUnixC:\Users\Desktop\Notes.txt
UOperatingSystemUnix/Users/Desktop/Notes.txt

Non-Unix supports disk letters and partitions (UOperatingSystemPartition). Unix uses a single root directory model.

flowchart TB
  subgraph row1[" "]
    direction LR
    OS["UOperatingSystem"] --> Root["UOperatingSystemRootDirectory / C:\\"] --> Users["Users directory"]
  end
  subgraph row2[" "]
    direction LR
    Desktop["Desktop"] --> File["UOperatingSystemFile"]
    Desktop --> Subdir["UOperatingSystemDirectory"]
    Users --> Docs["Documents directory"]
  end
  Root --> Desktop

Assign Default Directories on your OS Blueprint to a collection Data Asset (e.g. DA_NonUnix_DefaultDirectories). These create Desktop, Documents, Downloads, etc. at install time.

Duplicate collection assets from plugin content — do not modify originals.

Get Operating System (from device or program)
→ Get Directory From Path ("C:\\Users\\Desktop")
→ Construct File
File Class: BP_File_TextDocument
Parent Directory: (result above)

Use Construct Directory for folders. Check return values / errors — operations can fail when disk space (simulated) is exhausted.

Explorer and programs use:

  • Move File / Move Directory — change parent directory
  • Delete File / Delete Directory — respect bIsDeletable / bIsMovable on file defaults
  • Find File From Path — resolve path string to object

Search the context menu for Operating System when your graph has an OS reference.

UOperatingSystemStatics exposes path resolution and messenger lookup used across the plugin:

#include "Global/OperatingSystemStatics.h"
#include "Core/OperatingSystem.h"
UOperatingSystemDirectory* Dir = UOperatingSystemStatics::GetDirectoryFromPath(
OS, TEXT("C:\\Users\\Desktop"), OutError);

Consult the API page for the full function list on your plugin version.

Programs that manage files (Explorer, Terminal rm/mv, Mail attachments) implement IOperatingSystemExplorerInterface so the OS can refresh UI when contents change.

Bundled commands under OperatingSystemContent/.../Terminal/Commands/ demonstrate path parsing. Duplicate BP_CMD_* assets to add game-specific file operations.

Custom terminal command