SetCreationTimeUtc() public static method

public static SetCreationTimeUtc ( string path, System creationTimeUtc ) : void
path string
creationTimeUtc System
return void
Example #1
0
        public void TestSetCreationTimeUtcNonExistentDir()
        {
            var tempLongPathFilename = uncDirectory.Combine(Pri.LongPath.Path.GetRandomFileName());
            var dateTime             = DateTime.UtcNow.AddDays(1);

            Assert.Throws <FileNotFoundException>(() => Directory.SetCreationTimeUtc(tempLongPathFilename, dateTime));
        }
Example #2
0
 public static void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
 {
     if (_provider == null)
     {
         Directory.SetCreationTimeUtc(path, creationTimeUtc);
     }
     else
     {
         _provider.SetCreationTimeUtc(path, creationTimeUtc);
     }
 }
Example #3
0
        public void TestSetCreationTimeUtc()
        {
            var tempLongPathFilename = uncDirectory.Combine(Pri.LongPath.Path.GetRandomFileName());

            tempLongPathFilename.CreateDirectory();

            try {
                var dateTime = DateTime.UtcNow.AddDays(1);
                Directory.SetCreationTimeUtc(tempLongPathFilename, dateTime);
                var di = new DirectoryInfo(tempLongPathFilename);
                Assert.AreEqual(di.CreationTimeUtc, dateTime);
            }
            finally {
                Pri.LongPath.Directory.Delete(tempLongPathFilename);
            }
        }
Example #4
0
 public static void SetCreationTimeUtc(string path, System.DateTime creationTimeUtc) =>
 MSIOD.SetCreationTimeUtc(path, creationTimeUtc);
Example #5
0
 public void SetCreationTime(DateTimeOffset creationTime)
 => D.SetCreationTimeUtc(this.FullName, creationTime.UtcDateTime);
Example #6
0
 public override void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
 {
     Directory.SetCreationTimeUtc(path, creationTimeUtc);
 }