diff --git a/SparkleLib/SparkleHelpers.cs b/SparkleLib/SparkleHelpers.cs index 86fa20c8..21855f54 100755 --- a/SparkleLib/SparkleHelpers.cs +++ b/SparkleLib/SparkleHelpers.cs @@ -70,15 +70,16 @@ namespace SparkleLib { } } + // Check if a file is a symbolic link public static bool IsSymlink (string file) { FileAttributes attr = File.GetAttributes (file); - return ((attr & FileAttributes.ReparsePoint) == - FileAttributes.ReparsePoint); + return ((attr & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint); } + // Converts a UNIX timestamp to a more usable time object public static DateTime UnixTimestampToDateTime (int timestamp) { @@ -86,4 +87,11 @@ namespace SparkleLib { return unix_epoch.AddSeconds (timestamp); } } + + // Gets the relative path of two hierarchical absolute paths + public static string DiffPaths (string target, string source) + { + return target.Replace (source + Path.DirectorySeparatorChar, ""); + } } +