@@ -531,11 +531,28 @@ errNo: errno]; return s.st_size; } -+ (OFDate*)modificationDateOfFileAtPath: (OFString*)path ++ (OFDate*)accessTimeOfItemAtPath: (OFString*)path +{ + of_stat_t s; + + if (path == nil) + @throw [OFInvalidArgumentException exception]; + + if (of_stat(path, &s) != 0) + /* FIXME: Maybe use another exception? */ + @throw [OFOpenFileFailedException exceptionWithPath: path + mode: @"r" + errNo: errno]; + + /* FIXME: We could be more precise on some OSes */ + return [OFDate dateWithTimeIntervalSince1970: s.st_atime]; +} + ++ (OFDate*)modificationTimeOfItemAtPath: (OFString*)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; @@ -547,10 +564,27 @@ errNo: errno]; /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_mtime]; } + ++ (OFDate*)statusChangeTimeOfItemAtPath: (OFString*)path +{ + of_stat_t s; + + if (path == nil) + @throw [OFInvalidArgumentException exception]; + + if (of_stat(path, &s) != 0) + /* FIXME: Maybe use another exception? */ + @throw [OFOpenFileFailedException exceptionWithPath: path + mode: @"r" + errNo: errno]; + + /* FIXME: We could be more precise on some OSes */ + return [OFDate dateWithTimeIntervalSince1970: s.st_ctime]; +} #ifdef OF_HAVE_CHMOD + (void)changePermissionsOfItemAtPath: (OFString*)path permissions: (mode_t)permissions {