emacs-devel
[Top][All Lists]
Advanced

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

Re: dired-do-touch


From: Matthew Mundell
Subject: Re: dired-do-touch
Date: 24 Mar 2004 20:57:44 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Eli Zaretskii <address@hidden> writes:

> > From: Matthew Mundell <address@hidden>
> > 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.




reply via email to

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