feat: real stat metadata across all filesystems, plus mkdir and rmdir
This commit is contained in:
1 parent
ca5331c9db
commit
edc3452d61
14 files changed
+557
-25
No files matched your search
@@ -84,6 +84,13 @@ int64_t Timekeeping::GetUnixTimestamp() {
|
||||
return g_bootEpoch + (int64_t)(Timekeeping::GetMilliseconds() / 1000);
|
||||
}
|
||||
|
||||
int64_t Timekeeping::DateToUnixTimestamp(int year, int month, int day,
|
||||
int hour, int minute, int second) {
|
||||
if (year < 1970 || month < 1 || month > 12 || day < 1 || day > 31) return 0;
|
||||
if (hour < 0 || hour > 23 || minute < 0 || minute > 59 || second < 0 || second > 60) return 0;
|
||||
return DateToEpoch(year, month, day, hour, minute, second);
|
||||
}
|
||||
|
||||
bool Timekeeping::SetUnixTimestamp(int64_t unixSeconds) {
|
||||
if (unixSeconds < 0 || unixSeconds > 4102444799LL)
|
||||
return false;
|
||||
|
||||
@@ -52,6 +52,12 @@ namespace Timekeeping {
|
||||
|
||||
void Init(uint16_t Year, uint8_t Month, uint8_t Day, uint8_t Hour, uint8_t Minute, uint8_t Second);
|
||||
int64_t GetUnixTimestamp();
|
||||
|
||||
// Convert a UTC calendar date to a Unix timestamp. Returns 0 for dates
|
||||
// outside the representable range. Used by filesystem drivers that store
|
||||
// on-disk timestamps as calendar fields (e.g. FAT32).
|
||||
int64_t DateToUnixTimestamp(int year, int month, int day, int hour, int minute, int second);
|
||||
|
||||
DateTime GetDateTime();
|
||||
bool SetUnixTimestamp(int64_t unixSeconds);
|
||||
|
||||
|
||||
Reference in new issue
Block a user