Files
Umbraco-CMS/src/Umbraco.Core/IO/IFileSystemExtensions.cs
Matt@MBP13-PC 085f4a4fcf Updated Document code to use IFileSystem when copying
Added some helper extention methods for IFileSystem
2012-08-20 11:42:18 -01:00

25 lines
575 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Umbraco.Core.IO
{
public static class IFileSystemExtensions
{
internal static long GetSize(this IFileSystem fs, string path)
{
var s = fs.OpenFile(path);
var size = s.Length;
s.Close();
return size;
}
internal static void CopyFile(this IFileSystem fs, string path, string newPath)
{
fs.AddFile(newPath, fs.OpenFile(path));
}
}
}