mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-26 04:40:41 -08:00
Add touch_file() utility function
This commit is contained in:
@@ -31,7 +31,9 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include <utime.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
@@ -274,6 +276,13 @@ bool successful_exit (int status)
|
||||
return status != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0;
|
||||
}
|
||||
|
||||
void touch_file (const std::string& filename)
|
||||
{
|
||||
if (utimes(filename.c_str(), NULL) == -1) {
|
||||
throw System_error("utimes", "", errno);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_std_streams_platform ()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user