[Top][All Lists]

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

Re: dired-do-touch

From: Eli Zaretskii
Subject: Re: dired-do-touch
Date: 24 Mar 2004 09:11:01 +0200

> 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

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.

reply via email to

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