mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 08:48:55 +00:00
Ignore after period character of floating point in x-amz-meta-mtime
This commit is contained in:
parent
1d4867830b
commit
f2184e34dd
@ -748,9 +748,23 @@ bool delete_files_in_dir(const char* dir, bool is_remove_own)
|
||||
//-------------------------------------------------------------------
|
||||
// Utility functions for convert
|
||||
//-------------------------------------------------------------------
|
||||
time_t get_mtime(const char *s)
|
||||
time_t get_mtime(const char *str)
|
||||
{
|
||||
return static_cast<time_t>(s3fs_strtoofft(s));
|
||||
// [NOTE]
|
||||
// In rclone, there are cases where ns is set to x-amz-meta-mtime
|
||||
// with floating point number. s3fs uses x-amz-meta-mtime by
|
||||
// truncating the floating point or less (in seconds or less) to
|
||||
// correspond to this.
|
||||
//
|
||||
string strmtime("");
|
||||
if(str && '\0' != *str){
|
||||
strmtime = str;
|
||||
string::size_type pos = strmtime.find('.', 0);
|
||||
if(string::npos != pos){
|
||||
strmtime = strmtime.substr(0, pos);
|
||||
}
|
||||
}
|
||||
return static_cast<time_t>(s3fs_strtoofft(strmtime.c_str()));
|
||||
}
|
||||
|
||||
static time_t get_time(headers_t& meta, bool overcheck, const char *header)
|
||||
|
Loading…
Reference in New Issue
Block a user