Hi Alan
Its an exe. A part of the exe does a consolidation of data before presenting
it. This means selecting data from the same server and working with it using
a created dbf in the users appdata/local. This is the one causing problems.
DoEvents (no brackets) is supposed to get windows to do its own stuff before
continuing with the next line.
So I have use in select("flt2")
doevents
if file(blar)
delete blar
endif
doevents
the flt2 table is only used by the local machine and after the use it
appears as if it is still used for a few seconds (maybe I dont know) and the
delete comes back with the error. Like its still open.
Other PC's do the same thing and no problem so its not the data serve part.
Its not a service, its an exe that is run and the timer sorts out when
things run. But there is a manual run as well and that fails.
Al
-----Original Message-----
From: Alan Bourke
Sent: Friday, July 17, 2015 3:09 PM
To: [email protected]
Subject: Re: SMB2
I'm unclear as to why DoEvents() would have anything to do with closing
files.
Regarding drive caching, I haven't had to touch that since Windows 2000
days so I doubt that's an issue.
You also really don't want to turn SMB2 off and shouldn't have to these
days, assuming your server and workstations are up to date.
So - what does that leave?
This is running on a server. Is it a Windows service? An EXE run by the
scheduler? An EXE that starts when the server starts?
I would start with making the problem situation happen and then using
Process Explorer to see what has open handles on the file. Could be
another instance of your EXE. Could be a workstation. Could be AV. Could
be the Windows Indexing Service.
Could you amend the server code to wrap the delete in some error
handling and maybe use a sleep and retry?
Declare Sleep IN Win32API Integer nMilliseconds
lnTries = 1
Do while lnTries <= 10
Try
delete file (lcFile) && -- Attempt delete.
catch
sleep(5000) && -- No dice, sleep for 5 secs to let other process
release it.
finally
if !file(lcFile) && -- Did it get deleted? Then exit the Do loop.
exit
endif
endtry
lnTries = lnTries + 1
EndDo
* -- File still here after above?
if file(lcFile)
* ERROR Damn thing won't die
endif
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.