home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/time/c/RCS/utimes,v $
- * $Date: 1996/10/30 21:59:01 $
- * $Revision: 1.3 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: utimes,v $
- * Revision 1.3 1996/10/30 21:59:01 unixlib
- * Massive changes made by Nick Burret and Peter Burwood.
- *
- * Revision 1.2 1996/09/16 21:23:52 unixlib
- * CL_0002 Nick Burret
- * Minor changes to file handling
- * Change most error numbers, and use in assembler sources (SJC)
- * Various minor bug fixes and compatability changes.
- *
- * Revision 1.1 1996/04/19 21:35:00 simon
- * Initial revision
- *
- * Written by Nick Burrett, 17 Feb 1996.
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: utimes,v 1.3 1996/10/30 21:59:01 unixlib Rel $";
-
- #include <sys/time.h>
- #include <errno.h>
- #include <stddef.h>
- #include <sys/unix.h>
- #include <sys/os.h>
- #include <utime.h>
-
- /* The utimes function is like utime, but also lets you specify the
- fractional part of the file times.
-
- Change the access time of 'file' to tvp[0] and
- the modification time of 'file' to tvp[1].
-
- On RISC OS, we just alter the modification time. */
-
- int
- utimes (char *file, struct timeval tvp[2])
- {
- /* Firstly, we must convert the micro-seconds to centi-seconds. */
- time_t temp = (tvp[1].tv_usec / 10000) + tvp[1].tv_sec * 100;
- return utime (file, (struct utimbuf*)&temp);
- }
-