]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/fileutl.cc
merge with debian/experimental
[apt.git] / apt-pkg / contrib / fileutl.cc
index 2e62846d94ca6ed6ac2987a699f79ef746e5ca45..95058cbdee77b036c42aaabfb6cbe0222259fd7a 100644 (file)
@@ -447,6 +447,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                    /*{{{*/
 // ---------------------------------------------------------------------
 /* */