1. open() a file in 2.5

I think this is not important.. but I am curious..

Why does the first open() in 2.5 return 4 instead of 3 ?

Thanks! :P

new topic     » topic index » view message » categorize

2. Re: open() a file in 2.5

> I think this is not important.. but I am curious..
> 
> Why does the first open() in 2.5 return 4 instead of 3 ?

My guess is that Euphora uses a 1-based index, and C uses a 0-based
index. Since the front-end of Euphoria is written in Euphoria, this
causes most counts (file numbers, routine id's, etc...) to increase by
1.

~Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: open() a file in 2.5

On Sun, 13 Feb 2005 12:07:22 -0500, Greg Haberek <ghaberek at gmail.com>
wrote:

>
>> I think this is not important.. but I am curious..
>> 
>> Why does the first open() in 2.5 return 4 instead of 3 ?
>
>My guess is that Euphora uses a 1-based index, and C uses a 0-based
>index. Since the front-end of Euphoria is written in Euphoria, this
>causes most counts (file numbers, routine id's, etc...) to increase by
>1.
>
Greg, to clarify:
 0 is standard input,
 1 is standard output, and
 2 is standard error,
hence the first file you open (under 2.4) will get an id of 3.
Version 2.5 cannot have changed those meanings, otherwise getc(0),
printf(1,..) etc would all be broken. 

My guess is that a minor bug has crept in: filetable[4] is never used.
I had a quick look at execute.e but it offers no hints, maybe this is
necessary for execute.e and execute.c to be interchangeable?

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

4. Re: open() a file in 2.5

unknown wrote:
> I think this is not important.. but I am curious..
> 
> Why does the first open() in 2.5 return 4 instead of 3 ?

It does that in 2.5 alpha, not in 2.5 beta.

The 2.5 alpha front-end did not close the main Euphoria file
until after execution of the users program, so one extra file 
was open. The front end is written in Euphoria, 
so it uses the same file table as the users code. In 2.5 beta
the main file is closed prior to execution of the user's program.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu