Changed file stat times(a/c/mtime) management

This commit is contained in:
Takeshi Nakatani
2025-10-01 15:18:28 +00:00
committed by Andrew Gaul
parent 60fb557f14
commit 37e593aeb0
14 changed files with 675 additions and 523 deletions

View File

@ -27,24 +27,28 @@
#include <sstream>
#include <string>
#include <utility>
#include <fcntl.h>
#include <sys/stat.h>
#include "s3fs_logger.h"
#include "string_util.h"
//-------------------------------------------------------------------
// Global variables
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// Functions
//-------------------------------------------------------------------
std::string str(const struct timespec& value)
{
std::ostringstream s;
s << value.tv_sec;
if(value.tv_nsec != 0){
s << "." << std::setfill('0') << std::setw(9) << value.tv_nsec;
if(UTIME_OMIT == value.tv_nsec){
s << "UTIME_OMIT";
}else if(UTIME_NOW == value.tv_nsec){
s << "UTIME_NOW";
}else{
s << value.tv_sec;
if(value.tv_nsec != 0){
s << "." << std::setfill('0') << std::setw(9) << value.tv_nsec;
}
}
return s.str();
}