DeviceFileSystem
Namespace: Wisej.Hybrid
Assembly: Wisej.Hybrid
Provides methods to interact with the device's file system, allowing you to perform various file-related operations.
- C#
- VB.NET
public class DeviceFileSystem
Public Class DeviceFileSystem
Access this class through the FileSystem singleton.
Constructors
DeviceFileSystem()
Initializes a new instance of DeviceFileSystem.
Methods
CreateDirectory(path)
Creates a directory at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The directory path to create. |
DeleteDirectory(path)
Deletes the directory at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The directory path to delete. |
DeleteFile(path)
Deletes the file at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The file path to delete. |
Exists(path)
Determines whether a file exists at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The file path to check. |
Returns: Boolean. true if the file exists; otherwise, false.
GetFiles(directory)
Gets a list of file names in the specified directory.
| Parameter | Type | Description |
|---|---|---|
| directory | String | The directory path to query. |
Returns: String[]. An array of file names in the directory.
ReadBytes(path)
Reads the bytes from a file at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The file path to read from. |
Returns: Byte[]. An array of bytes representing the file contents.
ReadText(path)
Reads the text from a file at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The file path to read from. |
Returns: String. The text content of the file.
WriteBytes(path, bytes)
Writes the provided bytes to a file at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The file path to write to. |
| bytes | Byte[] | The bytes to write to the file. |
WriteText(path, contents)
Writes the provided text to a file at the given path.
| Parameter | Type | Description |
|---|---|---|
| path | String | The file path to write to. |
| contents | String | The text contents to write to the file. |