emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set last-modified time of a (local) file?


From: Kevin Rodgers
Subject: Re: Set last-modified time of a (local) file?
Date: Mon, 19 Jan 2004 14:31:26 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

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 via email to

[Prev in Thread] Current Thread [Next in Thread]