* creating temporary files
@ 2001-07-26 20:30 Rajat Datta
2001-07-26 20:53 ` Martin Dowie
2001-07-26 21:24 ` David C. Hoos
0 siblings, 2 replies; 6+ messages in thread
From: Rajat Datta @ 2001-07-26 20:30 UTC (permalink / raw)
Trying to run aflex on FreeBSD 4.2 using GNAT, I am coming across the
following problem: in two places the aflex code attempts to create a
temporary file using Create(Temp_File, OUT_FILE) which raises a
USE_ERROR exception.
Any workarounds besides changing the code to explicitly create a
temporary filename?
rajat
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: creating temporary files
2001-07-26 20:30 creating temporary files Rajat Datta
@ 2001-07-26 20:53 ` Martin Dowie
2001-07-26 22:31 ` Rajat Datta
2001-07-26 21:24 ` David C. Hoos
1 sibling, 1 reply; 6+ messages in thread
From: Martin Dowie @ 2001-07-26 20:53 UTC (permalink / raw)
if the file already exists then you may have to "Open"
it rather it rather than "Create" it.
"Rajat Datta" <rajat@austin.rr.com> wrote in message
news:slrn9m0vjn.1408.rajat@goteborg.austin.rr.com...
> Trying to run aflex on FreeBSD 4.2 using GNAT, I am coming across the
> following problem: in two places the aflex code attempts to create a
> temporary file using Create(Temp_File, OUT_FILE) which raises a
> USE_ERROR exception.
>
> Any workarounds besides changing the code to explicitly create a
> temporary filename?
>
> rajat
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: creating temporary files
2001-07-26 20:30 creating temporary files Rajat Datta
2001-07-26 20:53 ` Martin Dowie
@ 2001-07-26 21:24 ` David C. Hoos
2001-07-26 22:30 ` Rajat Datta
1 sibling, 1 reply; 6+ messages in thread
From: David C. Hoos @ 2001-07-26 21:24 UTC (permalink / raw)
To: comp.lang.ada
Since you didn't say what version of aflex you're using, or what version
of GNAT, it's hard to definitively answer the question.
The package GNAT.OS_Lib has a procedure Create_Temp_File which
will probably fill the bill.
I know not all versions of aflex that are out there are gnat-compatible,
but if memory serves me correctly, Pascal Obry ported a version which
is gnat-compatible. Take a look at
http://perso.wanadoo.fr/pascal.obry/archive/flexyacc.tar.gz
----- Original Message -----
From: "Rajat Datta" <rajat@austin.rr.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Thursday, July 26, 2001 3:30 PM
Subject: creating temporary files
> Trying to run aflex on FreeBSD 4.2 using GNAT, I am coming across the
> following problem: in two places the aflex code attempts to create a
> temporary file using Create(Temp_File, OUT_FILE) which raises a
> USE_ERROR exception.
>
> Any workarounds besides changing the code to explicitly create a
> temporary filename?
>
> rajat
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: creating temporary files
2001-07-26 21:24 ` David C. Hoos
@ 2001-07-26 22:30 ` Rajat Datta
2001-07-27 17:28 ` Pascal Obry
0 siblings, 1 reply; 6+ messages in thread
From: Rajat Datta @ 2001-07-26 22:30 UTC (permalink / raw)
On Thu, 26 Jul 2001 16:24:50 -0500,
David C. Hoos <david.c.hoos.sr@ada95.com> wrote:
>Since you didn't say what version of aflex you're using, or what version
>of GNAT, it's hard to definitively answer the question.
Sorry.
I'm using gnat-3.13p and aflex out of the link you suggested
(http://perso.wanadoo.fr/pascal.obry/archive/flexyacc.tar.gz), which
doesn't seem to have a version number, but has a file called CHANGES-1.4.
In the file main_body.adb, in procedure AFLEXINIT, around line 397,
the line
CREATE(TEMP_ACTION_FILE, OUT_FILE);
causes a USE_ERROR exception to be raised.
I will try to rewrite the two places using temporary files with
Create_Temp_File as you suggested. Thanks,
rajat
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: creating temporary files
2001-07-26 20:53 ` Martin Dowie
@ 2001-07-26 22:31 ` Rajat Datta
0 siblings, 0 replies; 6+ messages in thread
From: Rajat Datta @ 2001-07-26 22:31 UTC (permalink / raw)
On Thu, 26 Jul 2001 21:53:27 +0100,
Martin Dowie <martin.m.dowie@no.spam.ntlworld.com> wrote:
>if the file already exists then you may have to "Open"
>it rather it rather than "Create" it.
No, it's a temp file. I presume if Create() supports creating
temporary files if you specify an empty string as the name, it
will take care to avoid files that already exist.
rajat
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: creating temporary files
2001-07-26 22:30 ` Rajat Datta
@ 2001-07-27 17:28 ` Pascal Obry
0 siblings, 0 replies; 6+ messages in thread
From: Pascal Obry @ 2001-07-27 17:28 UTC (permalink / raw)
rajat@austin.rr.com (Rajat Datta) writes:
> On Thu, 26 Jul 2001 16:24:50 -0500,
> David C. Hoos <david.c.hoos.sr@ada95.com> wrote:
> >Since you didn't say what version of aflex you're using, or what version
> >of GNAT, it's hard to definitively answer the question.
>
> Sorry.
>
> I'm using gnat-3.13p and aflex out of the link you suggested
> (http://perso.wanadoo.fr/pascal.obry/archive/flexyacc.tar.gz), which
> doesn't seem to have a version number, but has a file called CHANGES-1.4.
>
> In the file main_body.adb, in procedure AFLEXINIT, around line 397,
> the line
> CREATE(TEMP_ACTION_FILE, OUT_FILE);
> causes a USE_ERROR exception to be raised.
Ok, this seems a GNAT/FreeBSD issue since I have been able to use flex/yacc
with GNAT under Windows.
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-07-27 17:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-26 20:30 creating temporary files Rajat Datta
2001-07-26 20:53 ` Martin Dowie
2001-07-26 22:31 ` Rajat Datta
2001-07-26 21:24 ` David C. Hoos
2001-07-26 22:30 ` Rajat Datta
2001-07-27 17:28 ` Pascal Obry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox