예제 #1
0
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 public Stream OpenWrite(Path path)
 {
     return File.OpenWrite(path.ToString());
 }
예제 #2
0
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 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
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 public DateTime GetLastWriteTime(Path path)
 {
     return File.GetLastWriteTime(path.ToString());
 }
예제 #4
0
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 public IEnumerable<Path> GetFiles(Path root, string pattern)
 {
     foreach(var item in Directory.GetFiles(root.ToString(), pattern))
         yield return new Path(item);
 }
예제 #5
0
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 public bool FileExists(Path path)
 {
     return File.Exists(path.ToString());
 }
예제 #6
0
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 public void DeleteFile(Path path)
 {
     File.Delete(path.ToString());
 }
예제 #7
0
파일: FileSystem.cs 프로젝트: danaxa/Pencil
 public void CopyFile(Path from, Path to, bool overwrite)
 {
     File.Copy(from.ToString(), to.ToString(), overwrite);
 }
예제 #8
0
파일: PathTests.cs 프로젝트: danaxa/Pencil
 public void Should_use_Path_DirectorySeparatorChar_for_subdirectories()
 {
     var path = new Path("Parent").Combine("Child");
     Assert.AreEqual(FXPath.Combine("Parent", "Child"), path.ToString());
 }