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 |
void |
Copies the file to the specified destination path.
|
| Delete |
void |
Deletes the file.
|
| Move |
void |
Moves the file to the specified destination path.
|
| Open |
Stream |
Opens the file using the specified options.
|
| SetCreationTime |
IFile |
Sets the date and time that the file was created.
|
| SetCreationTimeUtc |
IFile |
Sets the date and time, in Coordinated Universal Time (UTC), that the file was created.
|
| SetLastAccessTime |
IFile |
Sets the date and time that the specified file or directory was last accessed.
|
| SetLastAccessTimeUtc |
IFile |
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last accessed.
|
| SetLastWriteTime |
IFile |
Sets the date and time that the specified file or directory was last written to.
|
| SetLastWriteTimeUtc |
IFile |
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last written to.
|
Extension Methods
| Name | Value | Summary |
|---|---|---|
| Dump |
string |
Get a basic string representation of specified object.
From LoggingExtensions
Requires the Cake.Incubator addin
|
| IsClrAssembly |
bool |
Checks if file has CLR PE Header.
From FileExtensions
|
| IsIn |
bool |
Checks if the source is contained in a list
From EnumerableExtensions
Requires the Cake.Incubator addin
|
| NotNull |
void |
Throws an exception if the specified parameter's value is null.
From Extensions
Requires the Cake.Ftp addin
|
| NotNull |
void |
Throws an exception if the specified parameter's value is null.
From IssuesArgumentChecks
Requires the Cake.Issues addin
|
| Open |
Stream |
Opens the file using the specified options.
From FileExtensions
|
| Open |
Stream |
Opens the file using the specified options.
From FileExtensions
|
| OpenRead |
Stream |
Opens the file for reading.
From FileExtensions
|
| OpenWrite |
Stream |
Opens the file for writing.
If the file already exists, it will be overwritten.
From FileExtensions
|
| ReadLines |
IEnumerable |
Enumerates line in file.
From FileExtensions
|
| ThrowIfNull |
T |
Throws a
System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
| ThrowIfNull |
T |
Throws a
System.ArgumentNullException if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
| ToDictionary |
IDictionary |
From ObjectHelpers
Requires the Cake.DeployParams addin
|
| To |
string |
Returns the string value or a
Not set> markup suitable for Spectre.Console.
From StringExtensions
Requires the Cake.Issues addin
|
