Skip to main content

FileInfo Class

NuGet: GHIElectronics.TinyCLR.IO
Assembly: GHIElectronics.TinyCLR.IO
Namespace: System.IO

Provides information about a file and the means to create or delete it.

public sealed class FileInfo : FileSystemInfo

Constructors

FileInfo(string fileName)

public FileInfo(string fileName)

Creates a new instance for the file at the given path.

Properties

Name

public override string Name { get; }

The name of the file or directory. (inherited)

Length

public long Length { get; }

The size of the file in bytes.

DirectoryName

public string DirectoryName { get; }

The full path of the directory that contains the file.

Directory

public DirectoryInfo Directory { get; }

The directory that contains the file, or null if there is none.

Exists

public override bool Exists { get; }

Whether the file or directory exists. (inherited)

Methods

Create()

public FileStream Create()

Creates the file and returns a stream to it.

Returns FileStream

Delete()

public override void Delete()

Deletes the file or directory. (inherited)

ToString()

public override string ToString()

Returns the full path of the file.

Returns string