Re: [BLACKBOX] Is this a Files bug?

From: Campbell, Robert (SELEX GALILEO, UK) <robert.d.campbell{([at]})nowhere.xy>
Date: Tue, 20 Nov 2012 14:13:56 +0000

----boundary-LibPST-iamunique-818041954_-_-
Content-type: text/plain

~~The easy way is to leave file opened, let the garbage collector deals with
~~it, anyway, closing shared files is not nececcary.

I have commented out the file.Close line in my real application, which seems to still
work fine, and the TRAP problem has gone.

Thanks.

Is it generally bad practice to manually close files?

Thanks

Robert


Hi.

Seems like HostFiles.File.Close closes WinApi-reference in any case, not
just in the Exclusive mode,
> (*
> IF f.state = exclusive THEN
> CloseFile(f, res)
> ELSE
> CloseFileHandle(f, res)
> END
> *)


decision section is commented by someone :)

The easy way is to leave file opened, let the garbage collector deals with
it, anyway, closing shared files is not nececcary.


Best regards.


On Tue, 20 Nov 2012 17:21:43 +0400, Campbell, Robert (SELEX GALILEO, UK)
<robert.d.campbell{([at]})nowhere.xy

> Hi
>
> I have uncovered a simple example of some unexpected (undesirable !)
> behaviour.
>
> However I can't really decide if it is an implementation bug, or if I am
> just trying to do something
> unreasonable.
>
> The trap occurs when I
>
>
> 1) Open a Document in a Window from the Files-Open Menu
>
> 2) Use a BlackBox procedure to scan the file on disc for some
> information
>
> 3) Then edit the open Window.
>
> I get a TRAP ASSERT(f.state # closed, 20).
>
>
>
> You can try this with the attached example
>
>
> 1) Open the file
>
> 2) Click on <Ctrl>Q RdcFilesBug.Fetch
>
> 3) Type into the source code.
>
> Regards,
>
> Robert
> SELEX Galileo Ltd

> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex
> SS14 3EL
> A company registered in England & Wales. Company no. 02426132
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-818041954_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGZiaWRpcyBcZGVmZjB7XGZvbnR0YmwN
CntcZjBcZnN3aXNzIEFyaWFsO30NCntcZjFcZm1vZGVybiBDb3VyaWVyIE5ldzt9DQp7XGYyXGZu
aWxcZmNoYXJzZXQyIFN5bWJvbDt9DQp7XGYzXGZtb2Rlcm5cZmNoYXJzZXQwIENvdXJpZXIgTmV3
O319DQp7XGNvbG9ydGJsXHJlZDBcZ3JlZW4wXGJsdWUwO1xyZWQwXGdyZWVuMFxibHVlMjU1O30N
Clx1YzFccGFyZFxwbGFpblxkZWZ0YWIzNjAgXGYwXGZzMjAgfn5UaGUgZWFzeSB3YXkgaXMgdG8g
bGVhdmUgZmlsZSBvcGVuZWQsIGxldCB0aGUgZ2FyYmFnZSBjb2xsZWN0b3IgZGVhbHMgd2l0aCAg
XHBhcg0Kfn5pdCwgYW55d2F5LCBjbG9zaW5nIHNoYXJlZCBmaWxlcyBpcyBub3QgbmVjZWNjYXJ5
LlxwYXINClxwYXINCkkgaGF2ZSBjb21tZW50ZWQgb3V0IHRoZSBmaWxlLkNsb3NlIGxpbmUgaW4g
bXkgcmVhbCBhcHBsaWNhdGlvbiwgd2hpY2ggc2VlbXMgdG8gc3RpbGxccGFyDQp3b3JrIGZpbmUs
IGFuZCB0aGUgVFJBUCBwcm9ibGVtIGhhcyBnb25lLlxwYXINClxwYXINClRoYW5rcy5ccGFyDQpc
cGFyDQpJcyBpdCBnZW5lcmFsbHkgYmFkIHByYWN0aWNlIHRvIG1hbnVhbGx5IGNsb3NlIGZpbGVz
P1xwYX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vICBccGFyDQo+IExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSFxwYXINClxwYXIN
ClxwYXINCi0tIFxwYXINClVzaW5nIE9wZXJhJ3MgcmV2b2x1dGlvbmFyeSBlbWFpbCBjbGllbnQ6
IGh0dHA6Ly93d3cub3BlcmEuY29tL21haWwvXHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRv
IHVuc3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1gi
IHRvIExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSFxwYXINClxwYXINClxwYXINCi0tLS1ccGFyDQpU
byB1bnN1YnNjcmliZSwgc2VuZCBhIG1lc3NhZ2Ugd2l0aCBib2R5ICJTSUdOT0ZGIEJMQUNLQk9Y
IiB0byBMSVNUU0VSVkBMSVNUUy5PQkVST059fQCAAAAAEgAA
----boundary-LibPST-iamunique-818041954_-_---
Received on Tue Nov 20 2012 - 15:13:56 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:55 UTC