diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 15:19:47 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 15:19:47 +0200 |
commit | 3671f6810b6306a07f0002b0a808435dad367ab0 (patch) | |
tree | 67aa1a70ebf550af64e899348eaddabc07378886 /apt-pkg/contrib/fileutl.cc | |
parent | b20c16833e20da8e367221b32764889cafe5b4c1 (diff) | |
parent | 2ec858bc68bc2d79ec020fe24be2d76b7c5b6792 (diff) |
merged from lp:~mvo/apt/mvo
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 /*{{{*/ // --------------------------------------------------------------------- /* */ |