From: Etienne G. <et...@cs...> - 2005-12-26 21:01:01
|
Hi All, since octave:8> help isunix isunix is the user-defined function from the file /home=E6tienne/prog=F8ctave=F8ctave-forge=F8ctave-forge/main/general/isun= ix.m Always returns true. If you are on a windows machine, be sure to put an isunix.m which always returns false in your path. and isunix returns 1 under the octave-2.1.50 cygwin package, am I right to conclude that every user of that package who wants isunix to answer correctly should modify that function? TIA, =20 Etienne --=20 Etienne Grossmann ------ http://www.cs.uky.edu/~etienne |
From: Andy A. <ad...@nc...> - 2005-12-26 22:16:26
|
On 12/26/05, Etienne Grossmann <et...@cs...> wrote: > octave:8> help isunix > isunix is the user-defined function from the file > /home=E6tienne/prog=F8ctave=F8ctave-forge=F8ctave-forge/main/general/isun= ix.m > > Always returns true. If you are on a windows machine, be sure to > put an isunix.m which always returns false in your path. The semantics of 'isunix' depends on what you mean by UNIX. Strictly speaking, only certain well defined OSes are UNIX. Linux, for example, is not. On the other hand, maybe UNIX means OSes that behave like UNIX in most ways. cygwin has UNIX process semantics (ie. fork) and file semantics (symlinks, select on files, etc.) So, is cygwin UNIX? Clearly, a mingwin octave is not unix. Maybe isunix should make a specific test. -- Andy |
From: William P. Y. H. <wil...@gm...> - 2005-12-27 07:18:32
|
On 12/27/05, Andy Adler <ad...@nc...> wrote: > The semantics of 'isunix' depends on what you mean by UNIX. > Strictly speaking, only certain well defined OSes are UNIX. Linux, > for example, is not. > > On the other hand, maybe UNIX means OSes that behave like > UNIX in most ways. cygwin has UNIX process semantics > (ie. fork) and file semantics (symlinks, select on files, etc.) > > So, is cygwin UNIX? Clearly, a mingwin octave is not unix. > > Maybe isunix should make a specific test. > In Octave 2.9.4, isunix() is implemented as function retval =3D isunix () if (nargin =3D=3D 0) retval =3D octave_config_info ("unix"); else usage ("isunix ()"); endif endfunction AFAIK, it returns 1 on Cygwin (I know this by reading the sources, so I'm not very sure) |
From: Etienne G. <et...@cs...> - 2005-12-27 04:39:11
|
Hi Andy, thx for the answer. I should have added that I want to use isunix() to determine whether I want to execute a (linux) binary called (say) 'foo' or a windows binary called 'fooWin.exe'. So I really want isunix to return true iff it's Linux - my code will fail on other nixes but that's ok for now. Cheers, Etienne ps: More in detail on what I'm doing, I'm patching David Lowe's SIFT [1] image feature detector code for Matlab so that it'll run both on Matlab and Octave. His code runs both on Win and Linux. [1] David G. Lowe, "Distinctive image features from scale-invariant keypoints,"International Journal of Computer Vision, 60, 2 (2004), pp. 91-110. http://www.cs.ubc.ca/~lowe/keypoints/ On Mon, Dec 26, 2005 at 05:16:15PM -0500, Andy Adler wrote: # On 12/26/05, Etienne Grossmann <et...@cs...> wrote: # > octave:8> help isunix # > isunix is the user-defined function from the file # > /home=E6tienne/prog=F8ctave=F8ctave-forge=F8ctave-forge/main/general/= isunix.m # > # > Always returns true. If you are on a windows machine, be sure to # > put an isunix.m which always returns false in your path. #=20 # The semantics of 'isunix' depends on what you mean by UNIX. # Strictly speaking, only certain well defined OSes are UNIX. Linux, # for example, is not. #=20 # On the other hand, maybe UNIX means OSes that behave like # UNIX in most ways. cygwin has UNIX process semantics # (ie. fork) and file semantics (symlinks, select on files, etc.) #=20 # So, is cygwin UNIX? Clearly, a mingwin octave is not unix. #=20 # Maybe isunix should make a specific test. #=20 # -- # Andy #=20 --=20 Etienne Grossmann ------ http://www.cs.uky.edu/~etienne |
From: Bill D. <de...@se...> - 2005-12-27 06:39:53
|
One thing that I could see as a good option for this would be for isunix=20 to have variable output arguements. Perhaps something like [true/false,=20 osname, osversion, distro, distroversion]. Bill On Mon, 26 Dec 2005, Etienne Grossmann wrote: > > Hi Andy, > > thx for the answer. I should have added that I want to use isunix() to > determine whether I want to execute a (linux) binary called (say) > 'foo' or a windows binary called 'fooWin.exe'. So I really want isunix > to return true iff it's Linux - my code will fail on other nixes but > that's ok for now. > > Cheers, > > Etienne > > ps: More in detail on what I'm doing, I'm patching David Lowe's SIFT > [1] image feature detector code for Matlab so that it'll run both > on Matlab and Octave. His code runs both on Win and Linux. > > [1] David G. Lowe, "Distinctive image features from scale-invariant > keypoints,"International Journal of Computer Vision, 60, 2 (2004), > pp. 91-110. > > http://www.cs.ubc.ca/~lowe/keypoints/ > > > > On Mon, Dec 26, 2005 at 05:16:15PM -0500, Andy Adler wrote: > # On 12/26/05, Etienne Grossmann <et...@cs...> wrote: > # > octave:8> help isunix > # > isunix is the user-defined function from the file > # > /home=E6tienne/prog=F8ctave=F8ctave-forge=F8ctave-forge/main/general/= isunix.m > # > > # > Always returns true. If you are on a windows machine, be sure to > # > put an isunix.m which always returns false in your path. > # > # The semantics of 'isunix' depends on what you mean by UNIX. > # Strictly speaking, only certain well defined OSes are UNIX. Linux, > # for example, is not. > # > # On the other hand, maybe UNIX means OSes that behave like > # UNIX in most ways. cygwin has UNIX process semantics > # (ie. fork) and file semantics (symlinks, select on files, etc.) > # > # So, is cygwin UNIX? Clearly, a mingwin octave is not unix. > # > # Maybe isunix should make a specific test. > # > # -- > # Andy > # > > --=20 > Etienne Grossmann ------ http://www.cs.uky.edu/~etienne > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > --=20 If you make a mistake you right it immediately to the best of your ability. -- /usr/bin/fortune |