- closing shared files

From: CFB Software <"CFB>
Date: Tue, 17 Jan 2006 10:54:12 +1030

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

Hi Andrew,

What are you trying to achieve? 'Sharing' a file just means that you
don't care if anybody else changes it while you are working on it.
Whoever saves it last will be the one whose changes are preserved. Any
changes made by the other user (process) will be lost.

If you edit a shared file outside of BlackBox using NotePad, your
BlackBox program will not be aware of the changes unless you first save
them in NotePad and then reopen the file in BlackBox.

Chris Burrows
CFB Software
http://www.cfbsoftware.com


-----Original Message-----
From: blackbox{([at]})nowhere.xy
Thomas
Sent: Thursday, 12 January 2006 6:46 PM
To: BlackBox Mailing List
Subject: [BlackBox] - closing shared files


Hei BlackBox community,
 
            I am very confused about the need to close files that have
been opened in shared mode. Suppose I open a file in shared mode using f
:= Files.dir.Old(. Files.shared) and read the file and find some sort
of error in its contents that requires the file to be edited. So long as
the file f is not stored in a global variable I think there should be no
problem, I should be able to start say NotePad to edit the file. Do I
have to explicitly close the file f by calling f.Close? In the
documentation for module File it says
 
PROCEDURE (f: File) Close
NEW, ABSTRACT
Closes an open file. Close does nothing if the file is not open or if it
has been opened in "shared" mode. If a call to New or Old is not
balanced by a call to Close, the Close is later performed automatically,
at an unspecified time. If it is known that a file won't be used again,
it is recommended to call its Close procedure.
The file f and the riders operating on file f are not valid anymore
after closing f, i.e., no more file or rider operations may be performed
on it. However, the closed file can be retrieved and opened again by
procedure Old.
Close may call Flush internally.
Close should (but need not necessarily) be called explicitly after a
file is not needed anymore.
 
However looking at module HostFiles I am not sure that Close does
"nothing" for files opened in shared mode.

 
 
I suspect that statements like
 
IF Files.dir.Old(..files.shared) # NIL THEN . END

 
are causing problems. Maybe FINALIZE does not get called in this case?
 
Moi
 
            Andrew

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



----boundary-LibPST-iamunique-1257083000_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGY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YnlccGFyDQpwcm9jZWR1cmUgT2xkLlxwYXINCkNsb3NlIG1heSBjYWxs
IEZsdXNoIGludGVybmFsbHkuXHBhcg0KQ2xvc2Ugc2hvdWxkIChidXQgbmVlZCBub3QgbmVjZXNz
YXJpbHkpIGJlIGNhbGxlZCBleHBsaWNpdGx5IGFmdGVyIGFccGFyDQpmaWxlIGlzIG5vdCBuZWVk
ZWQgYW55bW9yZS5ccGFyDQogXHBhcg0KSG93ZXZlciBsb29raW5nIGF0IG1vZHVsZSBIb3N0Rmls
ZXMgSSBhbSBub3Qgc3VyZSB0aGF0IENsb3NlIGRvZXNccGFyDQoibm90aGluZyIgZm9yIGZpbGVz
IG9wZW5lZCBpbiBzaGFyZWQgbW9kZS5ccGFyDQogXHBhcg0KIFxwYXINCkkgc3VzcGVjdCB0aGF0
IHN0YXRlbWVudHMgbGlrZVxwYXINCiBccGFyDQpJRiBGaWxlcy5kaXIuT2xkKC4uZmlsZXMuc2hh
cmVkKSAjIE5JTCBUSEVOIC4gRU5EXHBhcg0KIFxwYXINCmFyZSBjYXVzaW5nIHByb2JsZW1zLiBN
YXliZSBGSU5BTElaRSBkb2VzIG5vdCBnZXQgY2FsbGVkIGluIHRoaXMgY2FzZT9ccGFyDQogXHBh
cg0KTW9pXHBhcg0KIFxwYXINCiAgICAgICAgICAgIEFuZHJld1xwYXINClxwYXINCi0tLSBCbGFj
a0JveFxwYXINCi0tLSBzZW5kIHN1YmplY3QgSEVMUCBvciBVTlNVQlNDUklCRSB0byBibGFja2Jv
eEBvYmVyb24uY2h9fQBzIGFyZSBwcmVz


----boundary-LibPST-iamunique-1257083000_-_---
Received on Tue Jan 17 2006 - 01:24:12 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:05 UTC