blob: fde6a3b9c2232fcaefe26593e72971c2778cdfe1 [file] [log] [blame]
Guido van Rossumbe0e9421993-12-24 10:32:00 +00001/***********************************************************
Guido van Rossum6d023c91995-01-04 19:12:13 +00002Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
Guido van Rossumbe0e9421993-12-24 10:32:00 +00004
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23******************************************************************/
24
25/* Subroutine to get the last modification time of a file */
26
27/* (A separate file because this may be OS dependent) */
28
Guido van Rossumb6775db1994-08-01 11:34:53 +000029#ifdef HAVE_CONFIG_H
30#include "config.h"
31#endif
32
Guido van Rossumbe0e9421993-12-24 10:32:00 +000033#include <sys/types.h>
34#include <sys/stat.h>
Guido van Rossum922d8ff1995-01-12 11:31:04 +000035#include "rename2.h"
Guido van Rossumbe0e9421993-12-24 10:32:00 +000036
37long
38getmtime(path)
39 char *path;
40{
41 struct stat st;
42 if (stat(path, &st) != 0)
43 return -1;
44 else
45 return st.st_mtime;
46}