File Class
Namespace: System.IO · Assembly: GHIElectronics.TinyCLR.IO
No description available.
public static class File
Methods
Copy(string sourceFileName, string destFileName)
public static void Copy(string sourceFileName, string destFileName)
No description available.
| Parameter | Type | Description |
|---|---|---|
sourceFileName | string | |
destFileName | string |
Copy(string sourceFileName, string destFileName, bool overwrite)
public static void Copy(string sourceFileName, string destFileName, bool overwrite)
Copies a file to a new file. (inherited)
| Parameter | Type | Description |
|---|---|---|
sourceFileName | string | The file to copy. |
destFileName | string | The name of the destination file |
overwrite | bool | Specifies if the destination should be overwritten if it already exists. Default true. |
Create(string path)
public static FileStream Create(string path)
Creates a WebRequest . (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns FileStream
Create(string path, int bufferSize)
public static FileStream Create(string path, int bufferSize)
Creates or overwrites a file. (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string | |
bufferSize | int | Size of the read/write buffer. 0 for no buffering. |
Returns FileStream — TinyFileStream that provides stream based access to the file.
Delete(string path)
public static void Delete(string path)
Deletes a file from the device. (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string |
Exists(string path)
public static bool Exists(string path)
Determines if the specified file exists. (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns bool — true if the file exists otherwise false.
Open(string path, FileMode mode)
public static FileStream Open(string path, FileMode mode)
No description available.
| Parameter | Type | Description |
|---|---|---|
path | string | |
mode | FileMode |
Returns FileStream
Open(string path, FileMode mode, FileAccess access)
public static FileStream Open(string path, FileMode mode, FileAccess access)
Opens a TinyFileStream for the specified file. (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string | |
mode | FileMode | |
access | FileAccess |
Returns FileStream — A TinyFileStream which provides stream based access to the file.
Open(string path, FileMode mode, FileAccess access, FileShare share)
public static FileStream Open(string path, FileMode mode, FileAccess access, FileShare share)
No description available.
| Parameter | Type | Description |
|---|---|---|
path | string | |
mode | FileMode | |
access | FileAccess | |
share | FileShare |
Returns FileStream
GetAttributes(string path)
public static FileAttributes GetAttributes(string path)
No description available.
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns FileAttributes
SetAttributes(string path, FileAttributes fileAttributes)
public static void SetAttributes(string path, FileAttributes fileAttributes)
No description available.
| Parameter | Type | Description |
|---|---|---|
path | string | |
fileAttributes | FileAttributes |
OpenRead(string path)
public static FileStream OpenRead(string path)
No description available.
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns FileStream
OpenWrite(string path)
public static FileStream OpenWrite(string path)
No description available.
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns FileStream
ReadAllBytes(string path)
public static byte[] ReadAllBytes(string path)
Opens a file, reads the content into a byte array and then closes the file. (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string |
Returns byte[] — A byte array containing the data from the file.
WriteAllBytes(string path, byte[] bytes)
public static void WriteAllBytes(string path, byte[] bytes)
Creates a new file, writes the byte array to the file and then closes it. The file is overwritten if it already exists. (inherited)
| Parameter | Type | Description |
|---|---|---|
path | string | |
bytes | byte[] |
Move(string sourceFileName, string destFileName)
public static void Move(string sourceFileName, string destFileName)
Moves a file from the source to the destination. (inherited)
| Parameter | Type | Description |
|---|---|---|
sourceFileName | string | Name of the file to move. |
destFileName | string | New name of the file. |