Beispiel #1
0
 public ResultOrError <bool> ChmodFile(string mode, string path)
 {
     try
     {
         clovershell.ExecuteSimple(string.Format("chmod {0} {1}", mode, path), 1000, true);
         return(ResultOrError <bool> .MakeResult(true));
     }
     catch (Exception ex)
     {
         return(MakeError <bool>(ex.Message));
     }
 }
        public ResultOrError <bool> SetLastModifiedTimeUtc(string path, DateTime time)
        {
            string newPath = ResolvePath(path);

            try
            {
                shell.ExecuteSimple(string.Format("touch -ct {0:yyyyMMddHHmm.ss} \"{1}\"", time, newPath), 1000, true);
                return(ResultOrError <bool> .MakeResult(true));
            }
            catch (Exception ex)
            {
                return(MakeError <bool>(ex.Message));
            }
        }
Beispiel #3
0
 /// <summary>
 /// Shortcut for ResultOrError<T>.MakeResult()
 /// </summary>
 private ResultOrError <T> MakeResult <T>(T result)
 {
     return(ResultOrError <T> .MakeResult(result));
 }