Article View: comp.os.ms-windows.programmer.misc
Article #2554OF_VERIFY, SHARE etc
From: Berthold K.P. Horn
Date: Thu, 07 Jan 1993 16:59
Date: Thu, 07 Jan 1993 16:59
31 lines
1518 bytes
1518 bytes
How can one get OF_VERIFY to really work?
-----------------------------------------
I want to be able to tell whether a file has changed since I last looked at it.
OpenFile with OF_VERIFY doesn't seem to do the right thing --- that is,
it never returns HFILE_ERROR. I do something like:
if ((hFile = OpenFile(OpenName, &OfStruct,
OF_REOPEN | OF_VERIFY | OF_SHARE_DENY_NONE)) == HFILE_ERROR) {
I'v tried various variations of this, including (LPSTR) NULL in place of
OpenName (string with the file name), leaving off the OF_REOPEN etc.
Now I have to resort to _fstat to check length and date/time, since
I suppose I could directly compare the four reserved bytes in OfStruct,
which seem to be some kind of file date/time code. But then that may
change in future...
How can one tell whether SHARE has been loaded?
---------------------------------------------
If it is not, then I don't have to worry about getting `Sharing Violations'
when I open a file WITHOUT specifying OF_SHARE_DENY_NONE or
OF_SHARE_DENY_READ/WRITE/EXCLUSIVE.
Berthold K.P. Horn
Cambridge, Massachusetts, USA
Technical Details
Message-ID:
<1ihnhhINN4o@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!mintaka.lcs.mit.edu!ai-lab!wheat-chex!bkphShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!mintaka.lcs.mit.edu!ai-lab!wheat-chex!bkph From: bkph@wheat-chex.ai.mit.edu (Berthold K.P. Horn) Newsgroups: comp.os.ms-windows.programmer.misc Subject: OF_VERIFY, SHARE etc Message-ID: <1ihnhhINN4o@life.ai.mit.edu> Date: 7 Jan 93 16:59:29 GMT Organization: MIT Artificial Intelligence Lab Lines: 31 NNTP-Posting-Host: wheat-chex.ai.mit.edu