delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/06/16:37:12

X-Spam-Check-By: sourceware.org
Date: Sun, 6 Aug 2006 16:36:55 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Checking XCOPY Exit Value in Cygwin Bash
Message-ID: <20060806203655.GC30223@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <74382BAFEAA DOT 000000D2wolfpack AT inbox DOT com>
Mime-Version: 1.0
In-Reply-To: <74382BAFEAA.000000D2wolfpack@inbox.com>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

On Sun, Aug 06, 2006 at 07:46:07AM -0800, Shane wrote:
>I am writing a automated build script for my project that will be run
>under cygwin.  I will copy my updated source files to the build
>directory and if there are updated files, the executables will be
>built.  To copy the source files, I had to use XCOPY since the
>directory structure should be preserved in the destination directory
>also.  To copy only the updated files, I used the /D switch for XCOPY.
>Now since I want to execute the source compile only if files in the
>build directory have been updated, I have to use the exit codes of
>XCOPY inside the script.  I tried checking the value of $! after
>executing XCOPY but it didnt work.  I couldn't find a solution in the
>internet too.  Currently I am piping the standard output to a file and
>checking if the number of files copied is 0 or not.  But I think this
>is not an elegant solution.  This is what I am doing now.

Is there some reason why you are not using "cp" to accomplish your task?
"cp --help" should provide you with all sorts of options for copying files.
You should be able to press "cp" into service for this.

Using DOS utilities and DOS paths for this type of thing is putting you
on the fringes of support for Cygwin.  I really wouldn't recommend it.
Clearly this is not such a Windows-specific problem that it outside of
the capabilities of a UNIX solution.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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