forked from cake-build/cake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IFile.cs
53 lines (46 loc) · 1.74 KB
/
IFile.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.IO;
namespace Cake.Core.IO
{
/// <summary>
/// Represents a file.
/// </summary>
public interface IFile : IFileSystemInfo
{
/// <summary>
/// Gets the path to the file.
/// </summary>
/// <value>The path.</value>
new FilePath Path { get; }
/// <summary>
/// Gets the length of the file.
/// </summary>
/// <value>The length of the file.</value>
long Length { get; }
/// <summary>
/// Copies the file to the specified destination path.
/// </summary>
/// <param name="destination">The destination path.</param>
/// <param name="overwrite">Will overwrite existing destination file if set to <c>true</c>.</param>
void Copy(FilePath destination, bool overwrite);
/// <summary>
/// Moves the file to the specified destination path.
/// </summary>
/// <param name="destination">The destination path.</param>
void Move(FilePath destination);
/// <summary>
/// Deletes the file.
/// </summary>
void Delete();
/// <summary>
/// Opens the file using the specified options.
/// </summary>
/// <param name="fileMode">The file mode.</param>
/// <param name="fileAccess">The file access.</param>
/// <param name="fileShare">The file share.</param>
/// <returns>A <see cref="Stream"/> to the file.</returns>
Stream Open(FileMode fileMode, FileAccess fileAccess, FileShare fileShare);
}
}