From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) by sourceware.org (Postfix) with ESMTPS id 20037394D88D for ; Wed, 14 Apr 2021 15:25:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 20037394D88D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca Received: from [192.168.1.104] ([68.147.0.90]) by shaw.ca with ESMTP id WhO5lc2ZkHmS3WhO6lfP3E; Wed, 14 Apr 2021 09:25:06 -0600 X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=60770952 a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=TImcKGuyeGIbufSLrCcA:9 a=QEXdDO2ut3YA:10 Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com References: <603461978.103298236.1618396574434.JavaMail.root@zimbra76-e14.priv.proxad.net> From: Brian Inglis Organization: Systematic Software Subject: Re: Cygwin DLL 3.2.0 (W10) Problem with touch (8.26) for old dates < 1970 Message-ID: <2b1d2695-9339-4673-47c6-341772be79ff@SystematicSw.ab.ca> Date: Wed, 14 Apr 2021 09:25:05 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <603461978.103298236.1618396574434.JavaMail.root@zimbra76-e14.priv.proxad.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfMObT3DumTlASL2jxhL6a05AjemFs5bmSLtYxeaDmjK5i8hX9K9+EPZxMtzKe7vqSQFcHO1cXXlpU8ZNtw4BCF8Tp46POPGLsCnAThgwGAmhQ0S1NU9t w2qy2addQ2jiMRJ3wrpCM6nA64CbJ7DTYB9J4dz3Ev7xPrRpY76+Kk4bRC0Sv3bEaVHACXa8bOYQN4520QHj9S7Z7PA0JEnknPc= X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 15:25:10 -0000 On 2021-04-14 04:36, akiki--- via Cygwin wrote: > I encountered problems with the use of timestamps in cygwin. > May be it's an old problem, I don't know, using essentially files "recently" created/modified. > I want to say after 1970 No problem, but before ... > To day: > touch -m -t 190001011200.00 x gives touch: format de date « 190001011200.00 » incorrect > touch -m -t 190101011200.00 x gives ok - with ls -l x: > -rw-r--r-- 1 user group 0 1 janv. 1910 x > touch used is well /bin/touch > By comparison on Ubuntu 18 LTS > touch -m -t 190001011200.00 x is correct > I know, timestamps are managed differently in windows and linux. > I see also with the new windows terminal with ubuntu > On windows file, like /mnt/c/x (windows is mounted by linux) > touch -m -t 190001011200.00 x ; echo $? gives > 0 #No error but timestamp is set to 1970-01-01 > On linux file as ~/x, it's correct; > So, which confidence to have with cygwin about files of timestamp 19xx before 1970. > May be it's ok after 1901. The answer is NOT. > touch -m -t 190101011200.00 x gives sometimes format de date incorrect > In some windows directories and more problematic, for a same directory, I don't understand why. > May be due to embedded mounts. > I hope to have been clear enough. What's your OS + version, Cygwin uname -srvmo, Windows filesystem (and underlying if networked), time zone? Please repeat touch tests, followed by ls -glo and --full-time if required. I have timestamped some historical documents and images with no problems. Works just fine for me on current Windows, Cygwin, NTFS back to Windows limits: $ for ((y=1980;y>1580;y-=10)); do touch -t ${y}12312359.59 t && ls -glo t || echo $y; done -rw-r--r--+ 1 1 Dec 31 1980 t -rw-r--r--+ 1 1 Dec 31 1970 t -rw-r--r--+ 1 1 Dec 31 1960 t -rw-r--r--+ 1 1 Dec 31 1950 t -rw-r--r--+ 1 1 Dec 31 1940 t -rw-r--r--+ 1 1 Dec 31 1930 t -rw-r--r--+ 1 1 Dec 31 1920 t -rw-r--r--+ 1 1 Dec 31 1910 t -rw-r--r--+ 1 1 Dec 31 1900 t -rw-r--r--+ 1 1 Dec 31 1890 t -rw-r--r--+ 1 1 Dec 31 1880 t -rw-r--r--+ 1 1 Dec 31 1870 t -rw-r--r--+ 1 1 Dec 31 1860 t -rw-r--r--+ 1 1 Dec 31 1850 t -rw-r--r--+ 1 1 Dec 31 1840 t -rw-r--r--+ 1 1 Dec 31 1830 t -rw-r--r--+ 1 1 Dec 31 1820 t -rw-r--r--+ 1 1 Dec 31 1810 t -rw-r--r--+ 1 1 Dec 31 1800 t -rw-r--r--+ 1 1 Dec 31 1790 t -rw-r--r--+ 1 1 Dec 31 1780 t -rw-r--r--+ 1 1 Dec 31 1770 t -rw-r--r--+ 1 1 Dec 31 1760 t -rw-r--r--+ 1 1 Dec 31 1750 t -rw-r--r--+ 1 1 Dec 31 1740 t -rw-r--r--+ 1 1 Dec 31 1730 t -rw-r--r--+ 1 1 Dec 31 1720 t -rw-r--r--+ 1 1 Dec 31 1710 t -rw-r--r--+ 1 1 Dec 31 1700 t -rw-r--r--+ 1 1 Dec 31 1690 t -rw-r--r--+ 1 1 Dec 31 1680 t -rw-r--r--+ 1 1 Dec 31 1670 t -rw-r--r--+ 1 1 Dec 31 1660 t -rw-r--r--+ 1 1 Dec 31 1650 t -rw-r--r--+ 1 1 Dec 31 1640 t -rw-r--r--+ 1 1 Dec 31 1630 t -rw-r--r--+ 1 1 Dec 31 1620 t -rw-r--r--+ 1 1 Dec 31 1610 t -rw-r--r--+ 1 1 Dec 31 1600 t touch: setting times of 't': Invalid argument 1590 $ for ((y=1600;y>1598;--y)); do touch -t ${y}12312359.59 t && ls -glo t || echo $y; done -rw-r--r--+ 1 1 Dec 31 1600 t touch: setting times of 't': Invalid argument 1599 $ y=1600; for ((m=12;m>10;--m)); do touch -t ${y}${m}312359.59 t && ls -glo t || echo $y-$m; done -rw-r--r--+ 1 1 Dec 31 1600 t touch: invalid date format ‘160011312359.59’ 1600-11 -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.]