Volker 

I try to use close, but look at the while condition, this set PortFile to none, 
because the find after last ocurrence, then the close not work properly.

If, after the while, I open again the same file, this operation have not error, 
and the port can be used normally.

The question is: what happen with PortFile under the surface?.


[

SomeThing: "x10"

PortFile: open/read %file
qty:  0
while [PortFile: find/tail PortFile SomeThing][
    qty: qty + 1
]

]

Cesar

----- Original Message ----- 
From: "Volker Nitsch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 21, 2005 3:52 PM
Subject: [REBOL] Re: [PORT]


> 
> On 7/21/05, Cesar Chavez <[EMAIL PROTECTED]> wrote:
> > Hi, everybody
> >=20
> > Please, look at next code, I need to search the occurrences of SomeThing =
> in a file and this code is OK.
> >=20
> > After the last ocurrence PortFile is set to none, then the while finish o=
> k, but what happen with the port, is it closed automatically?
> 
> Well, we have a 'close function, i would use that to make sure.
> I guess the GC closes unused ports too after a while, but with such
> things i prefer my own housekeeping.
> 
> >=20
> > I will appreciate any kind of comments.
> >=20
> > Thanks to all in advance
> >=20
> > C=E9sar
> >=20
> > [
> >=20
> > SomeThing: "x10"
> >=20
> > PortFile: open/read %file
> > qty:  0
> > while [PortFile: find/tail PortFile SomeThing][
> >     qty: qty + 1
> > ]
> >=20
> > ]
> >=20
> >=20
> > --
> > To unsubscribe from the list, just send an email to
> > lists at rebol.com with unsubscribe as the subject.
> >=20
> >=20
> 
> 
> --=20
> -Volker
> 
> "Any problem in computer science can be solved with another layer of
> indirection. But that usually will create another problem." David
> Wheeler
> -- 
> To unsubscribe from the list, just send an email to 
> lists at rebol.com with unsubscribe as the subject.
> 
> 
> 
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to