Skip to content

Commit 669d72b

Browse files
committed
use double for lastModified rather than time_t
1 parent 4d4f1a1 commit 669d72b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/attributes.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace attributes {
5656
explicit FileInfo(const List& fileInfo) {
5757
path_ = as<std::string>(fileInfo["path"]);
5858
exists_ = as<bool>(fileInfo["exists"]);
59-
lastModified_ = as<std::time_t>(fileInfo["lastModified"]);
59+
lastModified_ = as<double>(fileInfo["lastModified"]);
6060
}
6161

6262
// convert to R list
@@ -70,7 +70,7 @@ namespace attributes {
7070

7171
std::string path() const { return path_; }
7272
bool exists() const { return exists_; }
73-
time_t lastModified() const { return lastModified_; }
73+
double lastModified() const { return lastModified_; }
7474

7575
std::string extension() const {
7676
std::string::size_type pos = path_.find_last_of('.');
@@ -102,7 +102,7 @@ namespace attributes {
102102
private:
103103
std::string path_;
104104
bool exists_;
105-
time_t lastModified_;
105+
double lastModified_;
106106
};
107107

108108
// Remove a file
@@ -2686,7 +2686,7 @@ namespace attributes {
26862686
throw Rcpp::file_io_error(errno, path);
26872687
} else {
26882688
exists_ = true;
2689-
lastModified_ = buffer.st_mtime;
2689+
lastModified_ = static_cast<double>(buffer.st_mtime);
26902690
}
26912691
}
26922692

0 commit comments

Comments
 (0)