From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthew Mundell Newsgroups: gmane.emacs.devel Subject: Re: dired-do-touch Date: 24 Mar 2004 20:57:44 +0000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <878yhqnet3.fsf@sno.mundell.ukfsn.org> References: <20040321165848.0DB3C662F8@imf.math.ku.dk> <405DDAF3.2080608@math.ku.dk> <87vfkwbg51.fsf@sno.mundell.ukfsn.org> <877jxbqlp8.fsf@sno.mundell.ukfsn.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080163367 23164 80.91.224.253 (24 Mar 2004 21:22:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Mar 2004 21:22:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Mar 24 22:22:37 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 1B6Fpd-0003un-00 for ; Wed, 24 Mar 2004 22:22:37 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B6Fpc-0005Vy-00 for ; Wed, 24 Mar 2004 22:22:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6Fe3-0006Im-I5 for emacs-devel@quimby.gnus.org; Wed, 24 Mar 2004 16:10:39 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B6FWS-00042R-Fx for emacs-devel@gnu.org; Wed, 24 Mar 2004 16:02:48 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B6FVt-0003rG-IL for emacs-devel@gnu.org; Wed, 24 Mar 2004 16:02:44 -0500 Original-Received: from [217.158.120.143] (helo=mail.ukfsn.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6FRm-0002eF-7z; Wed, 24 Mar 2004 15:57:58 -0500 Original-Received: from localhost (lucy.ukfsn.org [127.0.0.1]) by mail.ukfsn.org (Postfix) with ESMTP id 18925E6DBD; Wed, 24 Mar 2004 20:57:14 +0000 (GMT) Original-Received: from mail.ukfsn.org ([127.0.0.1]) by localhost (lucy.ukfsn.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19696-02; Wed, 24 Mar 2004 20:57:14 +0000 (GMT) Original-Received: from sno.mundell.ukfsn.org (dsl213-218-238-16.as15444.net [213.218.238.16]) by mail.ukfsn.org (Postfix) with ESMTP id C8135E6DBA; Wed, 24 Mar 2004 20:57:13 +0000 (GMT) Original-Received: from sno.mundell.ukfsn.org ([10.0.0.3]) by sno.mundell.ukfsn.org with esmtp (Exim 3.36 #1 (Debian)) id 1B6FRZ-0000c1-00; Wed, 24 Mar 2004 20:57:45 +0000 Original-To: Eli Zaretskii Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 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:20855 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20855 Eli Zaretskii writes: > > From: Matthew Mundell > > Date: 23 Mar 2004 21:48:19 +0000 > > > > > > > + if (set_file_times (SDATA (encoded_absname), t, t) < 0) > > > > > + report_file_error ("Setting file times", Fcons (absname, Qnil)); > > > > > > > > I think this will throw an error on Windows if the file is a > > > > directory. So it would be good to single out that case on DOS_NT > > > > systems. > > > > Does the version below correctly handle the case? > > I don't know, but that was not what I had in mind. Whether a > directory is or isn't writable is not an issue, to the best of my > knowledge (IIRC, Windows ignores the read-only attribute when it > handles directories, so, e.g., you can delete such a directory > regardless). > > The issue is that Windows doesn't let you modify the directory's time > stamp at all. So on DOS_NT systems we should either refrain from > trying to change the time stamp of directories at all and print > something like "Cannot set time stamp of directories on this system", > or else more-or-less silently ignore errors in this function for > directories on such systems. The second alternative is probably > slightly better, since this is a primitive function that can be called > from deep inside some complex command, where signalling an error might > disrupt the rest of processing. > > FWIW, the DOS/Windows port of the `touch' utility doesn't print any > error message if invoked on a directory, it silently fails. I had copied the use of set_file_times in the WINDOWS_NT portion of copy-file, which is also in fileio.c. I see now that copy-file only sets the time when given a prefix argument, and that the doc notes that this will only work on some systems.