From owner-freebsd-questions@FreeBSD.ORG Sat Apr 22 05:56:18 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79AFA16A400 for ; Sat, 22 Apr 2006 05:56:18 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24D1F43D45 for ; Sat, 22 Apr 2006 05:56:17 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.4) id k3M5uGlZ027754; Sat, 22 Apr 2006 00:56:16 -0500 (CDT) (envelope-from dan) Date: Sat, 22 Apr 2006 00:56:16 -0500 From: Dan Nelson To: Gary Kline Message-ID: <20060422055616.GE73063@dan.emsphone.com> References: <20060421234246.GA42445@thought.org> <20060422031204.GD73063@dan.emsphone.com> <20060422042741.GA43461@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060422042741.GA43461@thought.org> X-OS: FreeBSD 5.5-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: FreeBSD Mailing List Subject: Re: getfiletime() and setfiletime() X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2006 05:56:18 -0000 In the last episode (Apr 21), Gary Kline said: > On Fri, Apr 21, 2006 at 10:12:04PM -0500, Dan Nelson wrote: > > In the last episode (Apr 21), Gary Kline said: > > > With all the billions-and-billions of lines of C hacked by people > > > reading this, do any of you have the functions that would get and > > > save-away the stat mtime, then be able to set the original mtime > > > of the file to what it was? > > > > > > I am getting back to working on a programm that cleans away > > > embedded html, jpg, and other non ASCII (or 8859-1) and leaves > > > just-plain-text. This from my ~/Mail/* files. Ideally, I would > > > like to set the timestamp of each file to what it was. So before > > > I re-invent wheels, I thought I'd ask the list. > > > > You can use mtree to do this. > > How, exactly? In ~/Mail are scores of files dating from 1991; for > the most part this Content-Type = "text/html" for rough example only > began in the late 90's. But there are scads of them. I'm looking at > pulling some of the guts from cp (copy -p that preserves the > time-stamp [and more]). If mtree is an easier route, then great. > How would I run this file > > -rw------- 1 kline wheel 306870 Dec 22 2004 ebay.com > > thru my filter and have wind up with its original timestamp. $ mtree -c -k time -p ~/Mail > mail.times $ run filter $ mtree -U -p ~/Mail < mail.times -- Dan Nelson dnelson@allantgroup.com