C# Class Phantom.Core.Builtins.IOFunctions

Exibir arquivo Open project: JeremySkinner/Phantom Class Usage Examples

Public Methods

Method Description
cp ( string source, string destination ) : void

Copies a file from one location to another.

exec ( string command ) : void
exec ( string command, IDictionary options ) : void
exec ( string command, string args ) : void

Executes the specified program with the specified arguments

exec ( string command, string args, IDictionary options ) : void

Executes the specified program with the specified arguments. You can also specify the working directory of the command by providing the hash option "WorkingDir"

mkdir ( string path ) : void

Creates a directory if it does not exist.

rm ( FileSystemInfo file ) : void

Deletes a file or directory

rm ( string path ) : void

Deletes a file or directory

Private Methods

Method Description
DeleteDirectory ( string path ) : void
DeleteFile ( string path ) : void
SetAttributesNormal ( DirectoryInfo dir ) : void

The Delete() method will fail with UnauthorizedAccessException if any files in the directory tree have the read-only flag. Delete() cannot delete anything with read-only flag even if the user running the application has priviliges to delete these files.

rmdir ( string path ) : void

Method Details

cp() public static method

Copies a file from one location to another.
public static cp ( string source, string destination ) : void
source string Source file
destination string Destination
return void

exec() public static method

public static exec ( string command ) : void
command string
return void

exec() public static method

public static exec ( string command, IDictionary options ) : void
command string
options IDictionary
return void

exec() public static method

Executes the specified program with the specified arguments
public static exec ( string command, string args ) : void
command string /// The command to execute ///
args string Additional args
return void

exec() public static method

Executes the specified program with the specified arguments. You can also specify the working directory of the command by providing the hash option "WorkingDir"
public static exec ( string command, string args, IDictionary options ) : void
command string /// The command to execute ///
args string Additional args
options IDictionary /// A hash of options to set on the process (like WorkingDir) ///
return void

mkdir() public static method

Creates a directory if it does not exist.
public static mkdir ( string path ) : void
path string
return void

rm() public static method

Deletes a file or directory
public static rm ( FileSystemInfo file ) : void
file System.IO.FileSystemInfo /// File or directory to delete ///
return void

rm() public static method

Deletes a file or directory
public static rm ( string path ) : void
path string /// File or directory to delete ///
return void