Filesystem Operations
The simulated filesystem is a tree of UOperatingSystemDirectory and UOperatingSystemFile objects owned by UOperatingSystem. Paths differ by OS type:
| OS type | Example path |
|---|---|
| UOperatingSystemNonUnix | C:\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
Default directories
Section titled “Default directories”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.
Blueprint — create a file
Section titled “Blueprint — create a file”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.
Blueprint — move and delete
Section titled “Blueprint — move and delete”Explorer and programs use:
- Move File / Move Directory — change parent directory
- Delete File / Delete Directory — respect
bIsDeletable/bIsMovableon 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.
C++ — static helpers
Section titled “C++ — static helpers”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.
Program integration
Section titled “Program integration”Programs that manage files (Explorer, Terminal rm/mv, Mail attachments) implement IOperatingSystemExplorerInterface so the OS can refresh UI when contents change.
Terminal commands
Section titled “Terminal commands”Bundled commands under OperatingSystemContent/.../Terminal/Commands/ demonstrate path parsing. Duplicate BP_CMD_* assets to add game-specific file operations.
Related
Section titled “Related”- Custom file type
- Create an operating system — Default Directories setup