----boundary-LibPST-iamunique-1752628680_-_-
Content-type: text/plain
So the test to reopen a file could be like this:
Function THLFileDEf.FileInUse(f: string): Boolean; // NIH
var hF: HFILE;
begin
Result := False;
If not FileExists(f) then exit;
hF := CreateFile(PChar(f),
GENERIC_READ or GENERIC_WRITE,
0, NIL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0);
Result := (hF = INVALID_HANDLE_VALUE);
If NOT Result Then CloseHandle(hF);
end;
Max Kleiner
armasuisse
Kasernenstrasse 19, CH-3003 Bern
Tel. +41 31 322 00 55, Mobile +41 79 366 30 08
UML 2006:
http://max.kleiner.com/uml2.htm
*************************************************
armasuisse components
-----Ursprüngliche Nachricht-----
Von: blackbox{([at]})nowhere.xy
Gesendet: Dienstag, 17. Januar 2006 16:41
An: BlackBox Mailing List
Betreff: [BlackBox] - AW: [BlackBox] - closing shared files
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1752628680_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBTbyB0aGUgdGVzdCB0byByZW9w
ZW4gYSBmaWxlIGNvdWxkIGJlIGxpa2UgdGhpczpccGFyDQpccGFyDQpGdW5jdGlvbiBUSExGaWxl
REVmLkZpbGVJbl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WZ0cmFnIHZvbiBPYmVyb24gbWlj
cm9zeXN0ZW1zIEFHLCBUZWNoLVN1cHBvcnRccGFyDQpHZXNlbmRldDogRGllbnN0YWcsIDE3LiBK
YW51YXIgMjAwNiAxNjo0MVxwYXINCkFuOiBCbGFja0JveCBNYWlsaW5nIExpc3RccGFyDQpCZXRy
ZWZmOiBbQmxhY2tCb3hdIC0gQVc6IFtCbGFja0JveF0gLSBjbG9zaW5nIHNoYXJlZCBmaWxlc1xw
YXINClxwYXINCi0tLSBCbGFja0JveFxwYXINCi0tLSBzZW5kIHN1YmplY3QgSEVMUCBvciBVTlNV
QlNDUklCRSB0byBibGFja2JveEBvYmVyb24uY2h9fQBnYm1WMwpJRnh3
----boundary-LibPST-iamunique-1752628680_-_---
Received on Wed Jan 18 2006 - 11:13:58 UTC