From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: Set last-modified time of a (local) file? Date: Mon, 19 Jan 2004 14:31:26 -0700 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <400C4CAE.7080506@yahoo.com> References: <87ptdh0wvb.fsf@emptyhost.emptydomain.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1074548004 13076 80.91.224.253 (19 Jan 2004 21:33:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2004 21:33:24 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Jan 19 22:33:07 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aih19-0006iz-00 for ; Mon, 19 Jan 2004 22:33:07 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aih19-0000lh-00 for ; Mon, 19 Jan 2004 22:33:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aih0l-0004KM-Je for emacs-devel@quimby.gnus.org; Mon, 19 Jan 2004 16:32:43 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aih0N-0004Jx-An for emacs-devel@gnu.org; Mon, 19 Jan 2004 16:32:19 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aigzq-0004D2-VB for emacs-devel@gnu.org; Mon, 19 Jan 2004 16:32:18 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aigzc-00048P-81 for emacs-devel@gnu.org; Mon, 19 Jan 2004 16:31:32 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AigzW-0006fP-00 for ; Mon, 19 Jan 2004 22:31:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AigzV-0006fH-00 for ; Mon, 19 Jan 2004 22:31:25 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AigzV-0003KG-00 for ; Mon, 19 Jan 2004 22:31:25 +0100 Original-Lines: 26 Original-X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19291 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19291 Kai Grossjohann wrote: > Is there a way in Emacs to set the last-modified time of a (local) > file? Here's how its done by Fcopy_file(): { EMACS_TIME atime, mtime; EMACS_SET_SECS_USECS (atime, st.st_atime, 0); EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); if (set_file_times (XSTRING (encoded_newname)->data, atime, mtime)) Fsignal (Qfile_date_error, Fcons (build_string ("Cannot set file date"), Fcons (newname, Qnil))); } If set_file_times() were exposed to Lisp, then you would be able to use it in Tramp. (If anyone does that, it'd be nice if the ATIME and MTIME arguments were lists, as returned by file-attributes.) -- Kevin Rodgers