Skip to main content

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.

ParameterTypeDescription
sourceFileNamestring
destFileNamestring

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)

ParameterTypeDescription
sourceFileNamestringThe file to copy.
destFileNamestringThe name of the destination file
overwriteboolSpecifies 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)

ParameterTypeDescription
pathstring

Returns FileStream

Create(string path, int bufferSize)

public static FileStream Create(string path, int bufferSize)

Creates or overwrites a file. (inherited)

ParameterTypeDescription
pathstring
bufferSizeintSize 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)

ParameterTypeDescription
pathstring

Exists(string path)

public static bool Exists(string path)

Determines if the specified file exists. (inherited)

ParameterTypeDescription
pathstring

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.

ParameterTypeDescription
pathstring
modeFileMode

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)

ParameterTypeDescription
pathstring
modeFileMode
accessFileAccess

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.

ParameterTypeDescription
pathstring
modeFileMode
accessFileAccess
shareFileShare

Returns FileStream

GetAttributes(string path)

public static FileAttributes GetAttributes(string path)

No description available.

ParameterTypeDescription
pathstring

Returns FileAttributes

SetAttributes(string path, FileAttributes fileAttributes)

public static void SetAttributes(string path, FileAttributes fileAttributes)

No description available.

ParameterTypeDescription
pathstring
fileAttributesFileAttributes

OpenRead(string path)

public static FileStream OpenRead(string path)

No description available.

ParameterTypeDescription
pathstring

Returns FileStream

OpenWrite(string path)

public static FileStream OpenWrite(string path)

No description available.

ParameterTypeDescription
pathstring

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)

ParameterTypeDescription
pathstring

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)

ParameterTypeDescription
pathstring
bytesbyte[]

Move(string sourceFileName, string destFileName)

public static void Move(string sourceFileName, string destFileName)

Moves a file from the source to the destination. (inherited)

ParameterTypeDescription
sourceFileNamestringName of the file to move.
destFileNamestringNew name of the file.