Storage POC
This runnable app demonstrates the platform APIs working together, without defining its own filesystem provider:
- Construct FileSystem and use it through StorageProvider.
- Resolve a Directory and describe a new File address.
- Write UTF-8 bytes through OutputStream, then close it.
- Read text through TextReader, implemented by StreamReader over InputStream.
- Discover SeekableStream, rewind, and read again.
- Enumerate mixed StorageItem values and traverse a child directory.
- Observe AlreadyExists and NotFound as expected errors.
Download Main.rvn, StoragePoc.rvnproj and expected output. Use matching SDK and runtime artifacts.
mkdir -p storage-demo/examples
dotnet msbuild StoragePoc.rvnproj -p:NeoCLRRoot=/path/to/neoclr -p:RavenSdkRoot=/path/to/raven-sdk
/path/to/neoclr/bin/neoclr run bin/neoclr/Debug/App.neoil --system bin/neoclr/Debug/System.neoil
Run from the directory containing storage-demo. Start each run with a fresh
fixture: creation deliberately refuses to replace an existing message.txt.
The key boundaries are StorageProvider → Directory/File → InputStream/OutputStream. TextReader adds text decoding; SeekableStream is optional. Callers depend on these interfaces while FileSystem supplies internal implementations. The separate disk/memory comparison exercises the same contracts with a bounded memory provider and short reads/writes.
The sample explicitly closes streams. Its readers use leaveOpen so the input can be repositioned after the reader closes. The current compiler requires an object view for discovering an unrelated interface capability; the sample uses a checked pattern through that view. Byte positions are not decoded-character positions.
See Storage providers, item interfaces and System.IO streams/readers for member contracts and limits. All operations are synchronous; task-returning Storage operations remain future work. Listing is bounded and non-atomic, and root mapping is not a security sandbox.
The File Transformer builds on this example to validate a JSON sensor report and save an acknowledgement with an explicit failed-save policy.