Method | Description | |
---|---|---|
CreateBinaryFileWithDirectories ( this root, string relativePath ) : Stream |
Creates a binary file in the given directory, or in a subdirectory of it. If the subdirectory does not exist, it will be created.
|
|
GetChildDirectory ( this root, string childName, bool createIfMissing ) : IFileSystemDirectory |
Gets a child directory and optionally creates it if missing
|
|
GetRelativePathFrom ( this root, IFileSystemDirectory innerRoot, string outerRelativePath ) : string |
Gets the relative path from a given directory to given file in a larger common directory subtree. r.Object.GetRelativePathFrom(a.Object, @"a\c.txt").Should().Be(@"c.txt"); r.Object.GetRelativePathFrom(a.Object, @"a.test\e.txt").Should().Be(@"..\a.test\e.txt"); r.Object.GetRelativePathFrom(a.Object, @"b\d.txt").Should().Be(@"..\b\d.txt");
|
public static CreateBinaryFileWithDirectories ( this root, string relativePath ) : Stream | ||
root | this | The root directory |
relativePath | string | Relative path of the file to be created |
return | Stream |
public static GetChildDirectory ( this root, string childName, bool createIfMissing ) : IFileSystemDirectory | ||
root | this | The root directory |
childName | string | The name of the direct child directory |
createIfMissing | bool | If |
return | IFileSystemDirectory |
public static GetRelativePathFrom ( this root, IFileSystemDirectory innerRoot, string outerRelativePath ) : string | ||
root | this | The directory subtree which contains both |
innerRoot | IFileSystemDirectory | The directory to get the path relative to |
outerRelativePath | string | The target path, relative to the |
return | string |