CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.92k stars 553 forks source link

File.GetLastAccessTime() + similar methods #1908

Open ghost opened 3 years ago

ghost commented 3 years ago

What is the usecase for this plug

foreach(string str in System.IO.Directory.GetFiles("0:/"))
{
    Console.WriteLine(str + " > " + System.IO.File.GetLastAccessTime(str));
}

Complexity of plug No idea

Describe alternatives you've considered Writing a giant file access log system which would be way too hard

Additional context @quajak said it should be implemented as FAT supports them

quajak commented 3 years ago

It seems like we are missing a few formatting plugs, which should be doable (maybe wait for .Net 5.0 to see how this will change). Internally, it looks like FatDirectoryEntry.cs needs methods to set creation time and update Modified/Access time. These methods will also have to be added to the FileSystem interface. We will then most likely have to plug some level of GetLastAccessTime and similar at some level to access the information from the fat file system.

quajak commented 3 years ago

https://github.com/CosmosOS/Cosmos/blob/f305364f1dfe02d410de53a692e22ba842e7c762/source/Cosmos.System2/FileSystem/FAT/Listing/FatDiretoryEntry.cs#L294