delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/15/23:19:17

From: jcook AT namerica DOT kla DOT com (John Cook)
Subject: RE: cp -p bug
15 Apr 1997 23:19:17 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <c=US%a=_%p=KLA_Instruments_%l=SJEXCHANGE3-970416003317Z-17091.cygnus.gnu-win32@sj_exchange1.kla.com>
Mime-Version: 1.0
Original-To: "'gnu-win32 AT cygnus DOT com'" <gnu-win32 AT cygnus DOT com>
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.995.52
Original-Sender: owner-gnu-win32 AT cygnus DOT com

>>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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019