Karim.Belabas on Wed, 27 Jun 2001 12:43:50 +0200 (MET DST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: precompiled cygwin binaries and read()


On Sun, 10 Jun 2001, Leonhard Möhring wrote:
> I'm experiencing some unexpected trouble with the precompiled cygwin
> binaries and read() [or \r for that matter].
> With the 2.1.1 as well as 2.1 and 2.0.20 cygwin using Win2K or Win95,
> and cygwin.dll from the bordeaux ftp-server (1.1.0) I get:
[...]
> ? write("x","a=1")
> ? read("x")
>   ***   error opening input file: x
>                                   ^-
> while there's no problem using the precompiled binaries with rsx or
> Mingw32. Using the 1.3.2 version of cygwin.dll didn't change anything.
> Does anybody know what's wrong here? Note that I did not install cygwin,
> but only put the dll in the path.

Hi,

  the culprit is the factory setting for GP 'path' default. [ If you read in
a file, whose name doesn't contain (the directory separator) '/', then GP
tries to find them in the directories listed there. ]

  On Unix machines, the directories in 'path' are separated by colons ':'
(just as $PATH is). On DOS/Win machines, this is the drive separator (eg. C:),
so a semi-colon ';' is used instead.  The RSX and Mingw32 binaries do notice
this sad fact.  The Cygwin binary thinks he's running on a Unix system,
which it is not  [ as I again experienced to my annoyance while investigating
the problem: simply running gp under gdb for a few seconds was enough to
freeze Win98, so that is couldn't even react to the Ctl-Alt-Del sequence.
Needed one soft and two hard reboots in hardly 10 minutes time. What an OS... ]

I'm fixing the default 'path' setting by explicitly checking for Cygwin.
As a temporary solutions, with the current binary, you can either
1) use explicit paths: read("./x")  [anything including '/' will not use 'path']
2) change the default 'path', i.e add 
  path = '.'    \\ or something like that e.g. '.;C:/gp'
in your GPRC file [you can use C:/_gprc, or /etc/gprc, or set the
%GPRC environment variable, see the user's manual].  A sample GPRC file is
provided as misc/gprc.dos in the DOS "documentation" archive
[ pub/pari/dos/GPD* on the megrez server ]

Hope this helps,

    Karim.

-- 
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://www.parigp-home.de/