示例#1
0
 public Stream OpenWrite(Path path)
 {
     return File.OpenWrite(path.ToString());
 }
示例#2
0
 public IEnumerable<Path> GetFilesRecursive(Path root, string pattern)
 {
     foreach(var item in Directory.GetFiles(root.ToString(), pattern, SearchOption.AllDirectories))
         yield return new Path(item);
 }
示例#3
0
 public DateTime GetLastWriteTime(Path path)
 {
     return File.GetLastWriteTime(path.ToString());
 }
示例#4
0
 public IEnumerable<Path> GetFiles(Path root, string pattern)
 {
     foreach(var item in Directory.GetFiles(root.ToString(), pattern))
         yield return new Path(item);
 }
示例#5
0
 public bool FileExists(Path path)
 {
     return File.Exists(path.ToString());
 }
示例#6
0
 public void DeleteFile(Path path)
 {
     File.Delete(path.ToString());
 }
示例#7
0
 public void CopyFile(Path from, Path to, bool overwrite)
 {
     File.Copy(from.ToString(), to.ToString(), overwrite);
 }
示例#8
0
 public void Should_use_Path_DirectorySeparatorChar_for_subdirectories()
 {
     var path = new Path("Parent").Combine("Child");
     Assert.AreEqual(FXPath.Combine("Parent", "Child"), path.ToString());
 }