X-Spam-Check-By: sourceware.org Date: Thu, 15 Feb 2007 14:22:33 -0500 (EST) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: winner wei cc: cygwin AT cygwin DOT com Subject: Re: is there any little-endian and big-endian issue with cygwin? In-Reply-To: <854144.58874.qm@web32407.mail.mud.yahoo.com> Message-ID: References: <854144 DOT 58874 DOT qm AT web32407 DOT mail DOT mud DOT yahoo DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com David, . Thanks. Also, reformatted. And again: . On Thu, 15 Feb 2007, winner wei wrote: > ----- Original Message ---- > From: Igor Peshansky > To: winner wei > Cc: cygwin AT XXXXXX DOT XXX . Thanks. > > On Thu, 15 Feb 2007, winner wei wrote: > > > > > My code works fine in Cygwin by command line, but when I run it > > > through a Java GUI launched from DOS the result is incorrect with > > > all the data which are not zero. The java Gui does nothing more than > > > launching the executables and provide a parameter file (I used the > > > exactly same parameter file by the command line run). So I guess if > > > there is any differences in the storage arrangement btw Cygwin and > > > DOS/Windows, or any other reason? > > > > Endianness is usually a property of the architecture[*]. Since both > > Cygwin and Windows run on the same architecture, there are no endianness > > issues. > > > > However, Cygwin and Windows do have different formats for filesystem > > paths, and may also have different concepts of line endings. You need > > to make sure that the path your Cygwin executable gets is in the > > format that Cygwin understands. If that is not your problem, you'll > > need to provide more details, and perhaps a > > . > > Igor > > [*] Yes, I know, except for special cases like network data layout, but > > we're not considering those here. > > Thank you very much, Igor. Here are two things I don't understand: > > 1, I haven't found a problem with path format at this point, suppose > there is one, why did command line run worked fine while the Java Gui > didn't? You have not provided enough information about how exactly you specify the path to the data file. For all I know, you may be invoking the program on the command line with POSIX-style path, and using java.io.File mechanisms to generate the path in your Java program -- that would definitely cause a path mismatch. But with the amount of detail you provided, we just don't know. You could try instrumenting the executable to print out the path to the data file it's getting. > 2, the parameter file (to the executable) provides input file name (hdf > format file), output file name, geographic coverage, warping method and > some other auxilliary data. when the code runs incorrectly, the data > points would have data like NaN, x.xE-38, I am not sure if you need more > to make some judges. You mentioned before that you provide the same file in both cases. Is that file generated anew every time, or is it a pre-existing file on disk? All of your previous input seemed to indicate the latter, in which case Java's representation of numbers should not be an issue. > By the way, I just saw another response to my question by Tim, he said > that Java uses big-endian and dos/win (cygwin) use little endian, do you > think it explained the reason? Thanks again. Again, if you re-generate the file, then Java's endianness may be the reason (I forgot that Java mandates big-endian representation in the spec for DataOutputStream). However, since you did not provide any details about how the numbers are written to the file, etc, we can only guess. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Freedom is just another word for "nothing left to lose"... -- Janis Joplin -- 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/