#include <sys/types.h>
#include <time.h>
#include <unistd.h>
+#include <utime.h>
+
#include "filesystem.h"
return 0;
}
-int64_t FileSystem::get_date(char *filename)
+int64_t FileSystem::get_date(const char *filename)
{
struct stat file_status;
bzero(&file_status, sizeof(struct stat));
return !result ? file_status.st_mtime : -1;
}
+void FileSystem::set_date(const char *path, int64_t value)
+{
+ struct utimbuf new_time;
+ new_time.actime = value;
+ new_time.modtime = value;
+ utime(path, &new_time);
+}
+
int64_t FileSystem::get_size(char *filename)
{
struct stat file_status;
return dir_list.values[entry];
}
+
// collapse ".", "..", "//" eg. x/./..//y = y
char *FileSystem::basepath(const char *path)
{