File Operations

Summary

Several extension methods when using File.

General

File(ICakeContext, string) Gets a file path from string.
GetFiles(ICakeContext, string[]) Gets FliePaths using glob patterns
Addin from Cake.Incubator.dll
GetMatchingFiles(ICakeContext, IEnumerable<FilePath>) Returns files in the same directory that have the same file name but different extensions
Addin from Cake.Incubator.dll
Move(ICakeContext, FilePath, FilePath) Obsolete: Use Cake.Common.IO.MoveFile instead
Addin from Cake.Incubator.dll
Move(ICakeContext, IEnumerable<FilePath>, DirectoryPath) Obsolete: Use Cake.Common.IO.MoveFiles instead
Addin from Cake.Incubator.dll
Plink(ICakeContext, string, string) Invokes Plink without settings
Addin from Cake.Putty.dll
Plink(ICakeContext, string, string, PlinkSettings) Invokes Plink using given settings.
Addin from Cake.Putty.dll
Pscp(ICakeContext, string, string) Invokes Pscp with a single from argument.
Addin from Cake.Putty.dll
Pscp(ICakeContext, string, string, PscpSettings) Invokes Pscp with a single from argument and settings.
Addin from Cake.Putty.dll
Pscp(ICakeContext, string[], string) Invokes Pscp with array of from arguments without settings..
Addin from Cake.Putty.dll
Pscp(ICakeContext, string[], string, PscpSettings) Invokes Pscp with array of from arguments.
Addin from Cake.Putty.dll

Copy

CopyFile(ICakeContext, FilePath, FilePath) Copies an existing file to a new file, providing the option to specify a new file name.
CopyFiles(ICakeContext, IEnumerable<FilePath>, DirectoryPath) Copies existing files to a new location.
CopyFiles(ICakeContext, IEnumerable<FilePath>, DirectoryPath, bool) Copies existing files to a new location.
CopyFiles(ICakeContext, IEnumerable<string>, DirectoryPath) Copies existing files to a new location.
CopyFiles(ICakeContext, IEnumerable<string>, DirectoryPath, bool) Copies existing files to a new location.
CopyFiles(ICakeContext, string, DirectoryPath) Copies all files matching the provided pattern to a new location.
CopyFiles(ICakeContext, string, DirectoryPath, bool) Copies all files matching the provided pattern to a new location.
CopyFileToDirectory(ICakeContext, FilePath, DirectoryPath) Copies an existing file to a new location.

Delete

DeleteFile(ICakeContext, FilePath) Deletes the specified file.
DeleteFiles(ICakeContext, IEnumerable<FilePath>) Deletes the specified files.
DeleteFiles(ICakeContext, string) Deletes the specified files.

Exists

FileExists(ICakeContext, FilePath) Determines whether the given path refers to an existing file.
FileSize(ICakeContext, FilePath) Gets the size of a file in bytes.

Move

MoveFile(ICakeContext, FilePath, FilePath) Moves an existing file to a new location, providing the option to specify a new file name.
MoveFiles(ICakeContext, IEnumerable<FilePath>, DirectoryPath) Moves existing files to a new location.
MoveFiles(ICakeContext, string, DirectoryPath) Moves existing files matching the specified pattern to a new location.
MoveFileToDirectory(ICakeContext, FilePath, DirectoryPath) Moves an existing file to a new location.

Path

MakeAbsolute(ICakeContext, FilePath) Makes the path absolute (if relative) using the current working directory.

Projects

GetOutputAssemblies(ICakeContext, FilePath, string) Gets the output assembly paths for solution or project files, for a specific build configuration
Addin from Cake.Incubator.dll
GetProjectAssembly(ICakeContext, FilePath, string) Gets the output assembly path for a project file, for a specific build configuration
Addin from Cake.Incubator.dll
GetSolutionAssemblies(ICakeContext, FilePath, string) Gets the output assembly paths for a solution file, for a specific build configuration
Addin from Cake.Incubator.dll