1. EU bug??

If you happen to try and open a print file twice, both with the same file
name, EU can't produce an error file. I made that mistake and it took a long
time to find it.... since it occurred after many many reads and writes...
here's the code. I accidently set pageNbr back to zero. You know, thinking
about this, I opened it again for each customer I ran into and it quit in
the H's, so I have no idea what it was doing. HOW could it open the same
output file so may times?? Does it make sense to open the same sequential
file for output multiple times?

procedure header()

    lnCount = 8
    if pageNbr=0 then
            prtFn = open(rptFile, "w")
            puts(prtFn,"+p\n")
            pageNbr=1
        else
            puts(prtFn,"+p\n")
            pageNbr += 1
    end if
......
.....

george

new topic     » topic index » view message » categorize

2. Re: EU bug??

George Walters wrote:
> If you happen to try and open a print file twice, both with the same file
> name, EU can't produce an error file. I made that mistake and it took a long
> time to find it.... since it occurred after many many reads and writes...
> here's the code. I accidently set pageNbr back to zero. You know, thinking
> about this, I opened it again for each customer I ran into and it quit in
> the H's, so I have no idea what it was doing. HOW could it open the same
> output file so may times?? Does it make sense to open the same sequential
> file for output multiple times?

Euphoria does not try to stop you from opening
the same file or device two or more times.
I don't know of any language that does.
You'll get a new file number (handle) for each open().
It might make some sense if you are reading
two logically different files, that just happen
to be the same file in a particular case, but
in general it's probably not a good idea.
I/O buffering will cause erratic results
if you are writing via two different handles.

Also keep in mind that Euphoria sets a limit of 25
simultaneously open files. This is
mainly to catch errors where you are in a loop,
opening, but never closing files.
Without Euphoria's limit the O/S would eventually
stop you, but the error wouldn't be very clear.

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

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

3. Re: EU bug??

George:

I think it would wise to have some locking access mechanism
to any file that has been opened so that a customer can not
try to update the file will it is in use by another user;
especially if you are writing an accounting package.

Bernie

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

4. Re: EU bug??

Bernie, you're right. We need more than file locking, we need

1. Locked exclusive - no reads or writes by others
2. Locked  - reads OK but no writes by others.
3. Record locks while in use by another 

and perhaps some others as well.

george
----- Original Message ----- 
From: "Bernie Ryan" <xotron at bluefrognet.net>
To: "EUforum" <EUforum at topica.com>
Subject: Re: EU bug??


> 
> 
> George:
> 
> I think it would wise to have some locking access mechanism
> to any file that has been opened so that a customer can not
> try to update the file will it is in use by another user;
> especially if you are writing an accounting package.
> 
> Bernie 
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu