IFile Interface

Summary

Represents a file.
Namespace
Cake.Core.IO
Interfaces
Implementing Types
graph BT Type-.->Interface0["IFileSystemInfo"] click Interface0 "/api/Cake.Core.IO/IFileSystemInfo" Type["IFile"] class Type type-node Implementing0["FakeFile"]-.->Type click Implementing0 "/api/Cake.Testing/FakeFile"

Syntax

public interface IFile : IFileSystemInfo

Properties

Name Value Summary
Attributes FileAttributes
Gets or sets the file attributes.
Length long
Gets the length of the file.
Path FilePath
Gets the path to the file.

Methods

Name Value Summary
Copy(FilePath, bool) void
Copies the file to the specified destination path.
Delete() void
Deletes the file.
Move(FilePath) void
Moves the file to the specified destination path.
Open(FileMode, FileAccess, FileShare) Stream
Opens the file using the specified options.

Extension Methods

Name Value Summary
Dump<IFile>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsClrAssembly() bool
Checks if file has CLR PE Header.
IsIn<IFile>(IFile[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<IFile>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<IFile>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
Open(FileMode) Stream
Opens the file using the specified options.
Open(FileMode, FileAccess) Stream
Opens the file using the specified options.
OpenRead() Stream
Opens the file for reading.
OpenWrite() Stream
Opens the file for writing. If the file already exists, it will be overwritten.
ReadLines(Encoding) IEnumerable<string>
Enumerates line in file
ThrowIfNull<IFile>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<IFile>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin