unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Set last-modified time of a (local) file?
Date: Mon, 19 Jan 2004 14:31:26 -0700	[thread overview]
Message-ID: <400C4CAE.7080506@yahoo.com> (raw)
In-Reply-To: 87ptdh0wvb.fsf@emptyhost.emptydomain.de

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

      reply	other threads:[~2004-01-19 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-18 21:28 Set last-modified time of a (local) file? Kai Grossjohann
2004-01-19 21:31 ` Kevin Rodgers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=400C4CAE.7080506@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).