cp -p bug

John Cook jcook@namerica.kla.com
Tue Apr 15 18:55:00 GMT 1997


>>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
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list