X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Message-ID: <3C791DAB.EE1EC15D@yahoo.com> Date: Sun, 24 Feb 2002 12:06:51 -0500 From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: cp complains about timestamps of directories References: <3405-Sun24Feb2002180347+0200-eliz AT is DOT elta DOT co DOT il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii wrote: > > Let's say you have a directory with 2 subdirectories, dir1 and dir2, > and let's say that dir1 has the files file1, file2, and file3 in it. > If you now type > > c:\foo> cp -pvPr dir1/* dir2 > > cp will print this: > > dir1 -> dir2/dir1 > dir1/file1 -> dir2/dir1/file1 > cp: preserving times for dir2/dir1: Permission denied (EACCES) > dir1/file2 -> dir2/dir1/file2 > dir1/file3 -> dir2/dir1/file3 > > I understand why the error message is printed, but the DJGPP port > shouldn't print it, since we know DOS/Windows doesn't let us change > the time stamps of directories, so this failure is normal behavior, > not something the user should be bothered with. > > I'm also puzzled as to why is the message printed after cp copies > dir1/file1, not after it copies dir1 into dir2. Probably because the copy message is generated before copying, and the act of copying generates the necessity of creating dir2/dir1. Read -> as "I am about to copy". > My cp.exe is dated June 4, 2001, and its size is 128000 bytes, in case > this is important. I assume this happens only when creating dir2/dir1, and not when using a preexisting one. There are ways of beating this, but are they worth the trouble? They involve storing the current time, setting the desired time, creating the directory, restoring the time, etc. and would be very hard to hide beneath the system calls. They would also lead to anomalous data, such as a subdirectory created before its parent. I think it would be better to simply document it somewhere, maybe in the FAQ under "anomalies, because DOS is Not Unix". -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)