diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-11-01 12:38:38 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-11-01 12:38:38 -0400 |
| commit | ae138566a94ed407c71dbc7a155c810b2389cc4b (patch) | |
| tree | ee6b79392d767b9d727041f4ab87d20ca73bbadc /node/Utils.cpp | |
| parent | e4044eeb709c09f5577f7e77260ccf997a298156 (diff) | |
| download | infinitytier-ae138566a94ed407c71dbc7a155c810b2389cc4b.tar.gz infinitytier-ae138566a94ed407c71dbc7a155c810b2389cc4b.zip | |
Updater code, work in progress...
Diffstat (limited to 'node/Utils.cpp')
| -rw-r--r-- | node/Utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/node/Utils.cpp b/node/Utils.cpp index c565d8c4..66bd27dd 100644 --- a/node/Utils.cpp +++ b/node/Utils.cpp @@ -265,6 +265,16 @@ uint64_t Utils::getLastModified(const char *path) return (((uint64_t)s.st_mtime) * 1000ULL); } +static int64_t getFileSize(const char *path) +{ + struct stat s; + if (stat(path,&s)) + return -1; + if (S_ISREG(s.st_mode)) + return s.st_size; + return -1; +} + std::string Utils::toRfc1123(uint64_t t64) { struct tm t; |
