summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-28 15:21:21 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-28 15:21:21 +0200
commitd074870043ffcd404e014d5793318427435c3ca1 (patch)
treeb291c24d6b8b11843fc008410a5ea1a60c0873dd /apt-pkg/contrib/fileutl.cc
parentd3d8ed4a439ffaa0cdec7053001f5810016a4c44 (diff)
parent3671f6810b6306a07f0002b0a808435dad367ab0 (diff)
merged from debian-experimental2
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc11
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 /*{{{*/
// ---------------------------------------------------------------------
/* */