IFile Interface

Summary

Represents a file. Not all implementations will support all available methods and may throw NotSupportedException.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.IO
Interfaces
Implementing Types
graph TD Interface0["IFileSystemEntry"]-.->Type click Interface0 "/api/Wyam.Common.IO/IFileSystemEntry" Type["IFile"] class Type type-node Type-.->Implementing0["TestFile"] click Implementing0 "/api/Wyam.Testing.IO/TestFile"

Syntax

public interface IFile : IFileSystemEntry

Properties

Name Value Summary
Directory IDirectory
Gets the directory of the file.
Length long
Gets the length of the file.
Path FilePath
Gets the path to the file.

Methods

Name Value Summary
CopyTo(IFile, bool, bool) void
Copies the file to the specified destination file.
Delete() void
Deletes the file.
MoveTo(IFile) void
Moves the file to the specified destination file.
Open(bool) Stream
Opens the file for reading and writing. This will either create the file if it doesn't exist or overwrite it if it does.
OpenAppend(bool) Stream
Opens the file for writing. This will either create the file if it doesn't exist or append to it if it does.
OpenRead() Stream
Opens the file for reading. If it does not exist, an exception will be thrown.
OpenWrite(bool) Stream
Opens the file for writing. This will either create the file if it doesn't exist or overwrite it if it does.
ReadAllText() string
Reads all text from the file.
WriteAllText(string, bool) void
Writes the specified text to a file.
GitHub