Xref: utzoo comp.unix.questions:7719 comp.unix.wizards:9562 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!oberon!bbn!uwmcsd1!marque!uunet!mcvax!ukc!warwick!maujd From: maujd@warwick.UUCP (Geoff Rimmer) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: touch (Was Re: -since option for ls -lt) Message-ID: <712@ubu.warwick.UUCP> Date: 21 Jun 88 13:37:06 GMT References: <344@ajpo.sei.cmu.edu> Sender: news@warwick.UUCP Reply-To: maujd@warwick.UUCP (Geoff Rimmer) Organization: Computer Science, Warwick University, UK Lines: 55 In article <344@ajpo.sei.cmu.edu> jrkelly@ajpo.sei.cmu.edu (John Kelly) writes: > >Has anyone implemented any of the following for Unix: > > 1. a directory listing command with a -since option? > 2. a program to force a specified modification time upon a specified file? > 3. a program to compare two dates/times and return an appropriate status? > >where the dates/times are given in string form, as in the output of "date" and >"ls"? Although I haven't done #1, I would have thought it would be a fairly easy C routine to write. Use readdir(3) to step thru the files, and stat(2) to find the modify time - then only print the info if the file is after the time/date specified by -since. #2 is already implemented on our (system V version) touch(1V) :- ---------------------------------------------------------------------- NAME touch - update times of last access and modification of a file SYSTEM V SYNOPSIS touch [ -c ] [ -a ] [ -m ] [ mmddhhmm[yy] ] filename ... DESCRIPTION touch causes the access and modification times of each argu- ment to be set to the current time. A file is created if it does not already exist. OPTIONS -c Do not create filename if it does not exist. -a Update only the access time. -m Update only the modification time. mmddhhmm[yy] Update the times to the specified time rather than to the current time. The first mm is the month, dd is the day of the month, hh is the hour, and the second mm is the minute; if yy is specified, it is the last two digits of the year, otherwise the current year is used. ---------------------------------------------------------------------- Don't know about #3. Geoff ------------------------------------------------------------ Geoff Rimmer, Computer Science, Warwick University, UK. maujd@uk.ac.warwick.opal "Oh, don't be so sentimental mother, things explode every day." ------------------------------------------------------------