as Izkata says. =20 (which is why I used 'read to make it a string to begin with)
the port you opened has no references to it anymore.=20 you can open another port with the same name, to the same place,=20 but it will not be the same port. as Volker said as some point the GC will collect the original port but till then there is not much you can do. On 7/21/05, Izkata <[EMAIL PROTECTED]> wrote: >=20 >=20 > > 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 no= t > > 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][ >=20 > The above line changed PortFile to refer to the string > that Find returned.... Not the port anymore >=20 > > 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 > >> >=3D20 > >> > Please, look at next code, I need to search the occurrences of > >> > SomeThing =3D > >> in a file and this code is OK. > >> >=3D20 > >> > After the last ocurrence PortFile is set to none, then the while fin= ish > >> > o=3D > >> 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. > >> > >> >=3D20 > >> > I will appreciate any kind of comments. > >> >=3D20 > >> > Thanks to all in advance > >> >=3D20 > >> > C=3DE9sar > >> >=3D20 > >> > [ > >> >=3D20 > >> > SomeThing: "x10" > >> >=3D20 > >> > PortFile: open/read %file > >> > qty: 0 > >> > while [PortFile: find/tail PortFile SomeThing][ > >> > qty: qty + 1 > >> > ] > >> >=3D20 > >> > ] > >> >=3D20 > >> >=3D20 > >> > -- > >> > To unsubscribe from the list, just send an email to > >> > lists at rebol.com with unsubscribe as the subject. > >> >=3D20 > >> >=3D20 > >> > >> > >> --=3D20 > >> -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. > > > > >=20 >=20 > -- > To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject. >=20 >=20 --=20 ... nice weather eh -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
