From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: dired-do-touch Date: 24 Mar 2004 09:11:01 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040321165848.0DB3C662F8@imf.math.ku.dk> <405DDAF3.2080608@math.ku.dk> <87vfkwbg51.fsf@sno.mundell.ukfsn.org> <877jxbqlp8.fsf@sno.mundell.ukfsn.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1080112196 22200 80.91.224.253 (24 Mar 2004 07:09:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Mar 2004 07:09:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Mar 24 08:09:51 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 1B62WN-0001z2-00 for ; Wed, 24 Mar 2004 08:09:51 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B62WM-0002DQ-00 for ; Wed, 24 Mar 2004 08:09:51 +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 1B62Vu-0004u9-B5 for emacs-devel@quimby.gnus.org; Wed, 24 Mar 2004 02:09:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B62Vo-0004pI-Mn for emacs-devel@gnu.org; Wed, 24 Mar 2004 02:09:16 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B62VI-0003xr-QH for emacs-devel@gnu.org; Wed, 24 Mar 2004 02:09:15 -0500 Original-Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.30) id 1B62VI-0003xK-5E; Wed, 24 Mar 2004 02:08:44 -0500 Original-To: Matthew Mundell In-reply-to: <877jxbqlp8.fsf@sno.mundell.ukfsn.org> (message from Matthew Mundell on 23 Mar 2004 21:48:19 +0000) 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:20840 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20840 > 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.