| Karim Belabas on Fri, 19 Oct 2012 02:48:57 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: temporary files under win32 |
* Loïc Grenié [2012-10-18 14:16]:
> 2012/10/18 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
>> I get report that PARI support for temporary files on win32 is not reliable.
>> In particular when running several instance of GP running factorisation.
>>
>> I would be glad if someone could review this code
>> (in src/language/es.c)
>>
>> To debug under gp, do
>> \gf2
>> factorint(2^251-1,14)
>
> It should work without problem under cygwin.
>
> Under win32, the problem is that all temporary files have the
> same name.
They shouldn't. In pari_unique_dir(), the final get_file() test ensures
that we at least try 26^2 names [ by replacing the last two letters in
filename by aa -> zz ].
> It sounds possible to use the same system as
> UNIX, creating in src/systems/win32/win32.c
>
> - pid_t getpid(void)
> which would return the pid of the process, using
> GetCurrentProcessId.
>
> - uid_t getuid(void)
> which would return some hash of the user name (using
> GetUserName).
That's a good idea, at least for getpid(); maybe multi-user Windows
systems are so infrequent that we needn't bother about getuid ?
Would you be willing to get a shot at this ?
Thanks !
K.B.
--
Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France) http://pari.math.u-bordeaux1.fr/ [PARI/GP]
`