Subject: RE: cp -p bug
From: [email-masked] (John Cook)

15 Apr 1997 23:19:17 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <c=US%a=_%p=KLA_Instruments_%l=[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "[email-masked]'" <[email-masked]>
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.995.52
Original-Sender: [email-masked]

>>cp -p (preserve file attributes) gives the new file a date
>>in 1969:
>>
>>E:\cords_nt\export\winnt\winnt\comm\nt_xkern\lib>dir ju*
>>
>>04/15/97  04:44p                     9 junk.txt
>>
>>E:\cords_nt\export\winnt\winnt\comm\nt_xkern\lib>cp -p junk.txt junk2.txt
>>
>>E:\cords_nt\export\winnt\winnt\comm\nt_xkern\lib>dir ju*
>>
>>04/15/97  04:44p                     9 junk.txt
>>12/31/69  08:00p                     9 junk2.txt

....Similarly, I find that 'touch' doesn't like the '--reference' 
or '-t' options.  On an NTFS partition, I see a problem similar 
to that above:

  26 //e/tmp/tmp$ ls -lrt
  total 36
  -rw-r--r--   1 500      everyone    70161 Apr 04 18:07 misc.zip
  -rw-r--r--   1 500      everyone      992 Apr 15 17:18 set.txt
  27 //e/tmp/tmp$ touch --reference=misc.zip set.txt
  28 //e/tmp/tmp$ ls -lrt
  total 36
  -rw-r--r--   1 500      everyone      992 Dec 31  1969 set.txt
  -rw-r--r--   1 500      everyone    70161 Apr 04 18:07 misc.zip
  29 //e/tmp/tmp$ touch set.txt
  30 //e/tmp/tmp$ ls -lrt
  total 36
  -rw-r--r--   1 500      everyone    70161 Apr 04 18:07 misc.zip
  -rw-r--r--   1 500      everyone      992 Apr 15 17:18 set.txt
  31 //e/tmp/tmp$ touch -t 01010520 set.txt
  32 //e/tmp/tmp$ ls -lrt
  total 36
  -rw-r--r--   1 500      everyone      992 Dec 31  1969 set.txt
  -rw-r--r--   1 500      everyone    70161 Apr 04 18:07 misc.zip
  33 //e/tmp/tmp$

Perhaps NTFS security doesn't like 'touch' messing with timestamps?
On a FAT partition, these 'touch' options have no effect at all:

  56 /tmp/tmp$ ls -lrt
  total 2
  -rw-r--r--   1 500      everyone       39 Nov 04 10:33 misc.zip
  -rw-r--r--   1 500      everyone      992 Apr 15 17:24 set.txt
  57 /tmp/tmp$ touch --reference=misc.zip set.txt
  58 /tmp/tmp$ ls -lrt
  total 2
  -rw-r--r--   1 500      everyone       39 Nov 04 10:33 misc.zip
  -rw-r--r--   1 500      everyone      992 Apr 15 17:24 set.txt
  59 /tmp/tmp$ touch -t 01010520 set.txt
  60 /tmp/tmp$ ls -lrt
  total 2
  -rw-r--r--   1 500      everyone       39 Nov 04 10:33 misc.zip
  -rw-r--r--   1 500      everyone      992 Apr 15 17:24 set.txt
  61 /tmp/tmp$

I am using gnu-win32 B17.1 on NT4.0 (no NT service packs installed).

John
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".