diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-29 13:42:15 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-29 13:42:15 +0200 |
commit | 1aab53cbb6b72bb5fb7853396dbbe9d4c8217230 (patch) | |
tree | 05ae903e889a8380dee1335c6d03e7699c82b0e8 /apt-pkg/contrib/fileutl.cc | |
parent | f448075d89fedde182e6c2a59c89808e403b7f66 (diff) | |
parent | 64dda04bd949ab73ca77732fcc5149cc7c2a5557 (diff) |
merged from the lp:~mvo/apt/mvo branch
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r-- | apt-pkg/contrib/fileutl.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 50019872e..85dc6f600 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -446,6 +446,17 @@ string SafeGetCWD() return S; } /*}}}*/ +// GetModificationTime - Get the mtime of the given file or -1 on error /*{{{*/ +// --------------------------------------------------------------------- +/* We return / on failure. */ +time_t GetModificationTime(string const &Path) +{ + struct stat St; + if (stat(Path.c_str(), &St) < 0) + return -1; + return St.st_mtime; +} + /*}}}*/ // flNotDir - Strip the directory from the filename /*{{{*/ // --------------------------------------------------------------------- /* */ |