delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/12/02/13:43:19

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <32904332.post@talk.nabble.com>
Date: Fri, 2 Dec 2011 10:42:56 -0800 (PST)
From: ajshower <ajshower AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Redirecting output from running proc doesn't modify the "last modified time" field for target file
In-Reply-To: <CAG_2cTn_1UHZy-13ACu-EPMaUSSSOr38s1_Rc0ccmdS2JDyJSQ@mail.gmail.com>
MIME-Version: 1.0
References: <32903475 DOT post AT talk DOT nabble DOT com> <CAG_2cTn_1UHZy-13ACu-EPMaUSSSOr38s1_Rc0ccmdS2JDyJSQ AT mail DOT gmail DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

>IMHO, this is a very dubious "feature" to depend upon.  If 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 presenting
the problem accurately.  My process is to call  Runtime.getRuntime.exec()
within a java process which opens cygwin/bin/bash.exe and then runs the
redirection command from within the bash.  From the same java process that
called exec(), I'm trying to monitor the last modified time based on what's
going on in the previously called bash.exe.  That does sound pretty
convoluted.  I guess it's some kind of scope problem, but checking length()
is working, so it's all moot anyway.

I'll close this thread.

-Alex
-- 
View this message in context: http://old.nabble.com/Redirecting-output-from-running-proc-doesn%27t-modify-the-%22last-modified-time%22-field-for-target-file-tp32903475p32904332.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
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

- Raw text -


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