From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11669 invoked by alias); 2 Dec 2011 18:50:45 -0000 Received: (qmail 11658 invoked by uid 22791); 2 Dec 2011 18:50:44 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f45.google.com (HELO mail-ww0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Dec 2011 18:50:31 +0000 Received: by wgbds13 with SMTP id ds13so1325384wgb.2 for ; Fri, 02 Dec 2011 10:50:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.14.41 with SMTP id c41mr725581wec.94.1322851829769; Fri, 02 Dec 2011 10:50:29 -0800 (PST) Received: by 10.216.21.196 with HTTP; Fri, 2 Dec 2011 10:50:29 -0800 (PST) In-Reply-To: <32904332.post@talk.nabble.com> References: <32903475.post@talk.nabble.com> <32904332.post@talk.nabble.com> Date: Fri, 02 Dec 2011 18:50:00 -0000 Message-ID: Subject: Re: Redirecting output from running proc doesn't modify the "last modified time" field for target file From: Jon Clugston To: cygwin@cygwin.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-12/txt/msg00029.txt.bz2 On Fri, Dec 2, 2011 at 1:42 PM, ajshower wrote: > >>IMHO, this is a very dubious "feature" to depend upon. =A0If you want to >>know if the file has changed, why not check its length instead? > > I have switched to using the length instead but I was interested in what > people thought of the issue. > > I'm having trouble reproducing this using just Cygwin so I'm not presenti= ng > the problem accurately. =A0My process is to call =A0Runtime.getRuntime.ex= ec() > within a java process which opens cygwin/bin/bash.exe and then runs the > redirection command from within the bash. =A0From the same java process t= hat > called exec(), I'm trying to monitor the last modified time based on what= 's > going on in the previously called bash.exe. =A0That does sound pretty > convoluted. =A0I guess it's some kind of scope problem, but checking leng= th() > is working, so it's all moot anyway. > I reproduced your symptoms with this simple shell script: while sleep 10 ; do echo done >x.log & While this loop is running, the timestamp on "x.log" doesn't change (whereas on Linux it changes every 10 seconds). It sure looks to me that Windows just doesn't bother updating the file timestamp while it is open. I don't know if this update is required by POSIX - I would doubt that it is. Jon -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple