Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IFileSystem

interface IFileSystem
Extends com.amazon.apmf.IStandard Defines common functionality for accessing and manipulating files and directories.

Methods

openFile()

IFile* openFile(string path, OpenMode mode)
Opens a file with the specified mode.

Parameters

path
string — Required The path of the file to open.
mode
OpenMode — Required The mode to open the file in.

Returns

IFile* The handle to the opened file.

Throws


removeFile()

void removeFile(string path)
Deletes a file at the path.

Parameters

path
string — Required The path of the file to delete.

Throws


removeDir()

void removeDir(string path)
Deletes a directory at the path.

Parameters

path
string — Required The path of the directory to delete.

Throws


removeDirAll()

void removeDirAll(string path)
Deletes a directory at the path and all its content.

Parameters

path
string — Required The path of the directory to delete.

Throws


readFileAsString()

string readFileAsString(string path, string encoding)
Reads the entire content of a text file into a string.

Parameters

path
string — Required The path to the file.
encoding
string — Required The encoding to use when reading the file.

Returns

string The content of the file as a UTF-8 string.

Throws


writeStringToFile()

i32 writeStringToFile(string path, string content, string encoding)
Writes a string to a text file.

Parameters

path
string — Required The path to the file.
content
string — Required The string content to write.
encoding
string — Required The encoding to use when writing the file.

Returns

i32 The number of bytes written to the file

Throws


getEntries()

IDirEntry*[] getEntries(string path)
Gets directory entries for the given path.

Parameters

path
string — Required The path to the directory.

Returns

IDirEntry*[] Array of IDirEntry objects representing each entry.

Throws


Last modified on October 22, 2026