This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: is there any little-endian and big-endian issue with cygwin?
- From: Igor Peshansky <pechtcha at cs dot nyu dot edu>
- To: winner wei <blueleaf4tg at yahoo dot com>
- Cc: cygwin at cygwin dot com
- Date: Thu, 15 Feb 2007 14:22:33 -0500 (EST)
- Subject: Re: is there any little-endian and big-endian issue with cygwin?
- References: <854144.58874.qm@web32407.mail.mud.yahoo.com>
- Reply-to: cygwin at cygwin dot com
David,
<http://cygwin.com/acronyms/#PPIOSPE>. Thanks.
Also, <http://cygwin.com/acronyms/#TOFU> reformatted.
And again: <http://cygwin.com/acronyms/#PCYMTWLL>.
On Thu, 15 Feb 2007, winner wei wrote:
> ----- Original Message ----
> From: Igor Peshansky <pechtcha@XX.XXX.XXX>
> To: winner wei <blueleaf4tg@XXXXX.XXX>
> Cc: cygwin@XXXXXX.XXX
<http://cygwin.com/acronyms/#PCYMTNQREAIYR>. 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
> > <http://cygwin.com/acronyms/#STC>.
> > 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@cs.nyu.edu | igor@watson.ibm.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/