When you reported this error in the harbour-users group you mentioned a
sharing violation error (DOS Error 32), which is an error on the OS
level meaning that the file is already open. Is it still 32? Have you
investigated why the file might be open? Could it, for example, be a
problem with the CachedOpenLimit registry setting keeping the file open
from a previous use? I could not download your 801 KB zip file for some
reason (no reaction at all except a new page that suggested that I
should open an account), but what is the difference between the download
and the example below? Does the sample included here exhibit the DOS
error 32 problem in your environment?
Regards,
Klas
> Thanks for helping me.
> Yes, I am also getting the same error.
> The file is not open and the folder is not shared.
> Just download the .zip and unzip in the desktop.
> I provide a new download url:
> http://demo.ovh.com/es/5a0f7902749392cdc7d498d584111b9f/
> The sample shows the problem.
> Please, indicate if the link does not work.
I cannot test under Win7, but I ran about 100 iterations under XP
without problems. BTW, if you report what you suspect is a Harbour bug,
do not include any FiveWin or other 3rd party stuff, just plain Harbour.
I still suspect the CachedOpenLimit setting in your registry. The NT
family of operating systems is designed to not close files that the
application closes until after a while. And as long as the file is open
it cannot be erased or replaced. Below is what Microsoft says about it
in an old KB article (http://support.microsoft.com/kb/124916) that
refers to the original NT version, but the optimization is still there
in newer Windows versions. It can be optimized for file sharing database
systems (like Clipper and Harbour) by setting it to zero. That is what I
always do on systems where my applications run - including my own,
which probably explains my results.
"There is an optimization in Windows NT version 3.5 which controls
whether or not a file is actually closed on the server when requested to
do so by the client. This optimization is controlled by the Registry
parameter, CachedOpenLimit. If the server owns an oplock on a file when
the client closes it, although the server will return the Close Server
Message Block (SMB) response indicating that the file has been closed,
it will keep the file open locally (that is, it removes the RFCB, but
maintains the LFCB and does not issue the local NtClose() request), on
the assumption that the client may soon reopen the file. If the client
does reopen the file, this greatly reduces the time required to respond
to the request."
Also see the link I provided in the other thread for further info.
Regards,
Klas
On 2012.02.12 14:36, John Salazar wrote:
> It may be downloaded at:
> http://oron.com/8otfjgsek4zq
Sorry, it offered to download a large .zip, so, I skipped this.
> FERASE (pPath+"\CUSTOMER.CDX") // It�s not opened and it has
> a different name than dbf
It is not opened on the first call to reindex() only, later you create
index and leave it open. So, I would expect FERASE() to fail on some OS
and on next call to get access/sharing violation error on:
> INDEX ON FIELD->LAST TO (pPath+"\CUSTOMER")
What is your problem, that you get an error, or that you do not get (not
always get) an error?
Regards,
Mindaugas
On 2012.02.13 17:14, John Salazar wrote:
> I get the error sometimes.
>
> I modified the sample as follows:
> http://demo.ovh.com/en/5f778b0a078d64d9431f5b7153f675ff/
It looks like you ignore messages (and possible help) from other user. I
think most people do not care about the links. You also ignored Viktor's
message about bugs in your sample and your sample is not self contained.
> And now I get sometimes:
> Error description: (DOS Error 5) DBFCDX/1006 Create error: C:\Users
> \John\Desktop\harbour\DATA\CUSTOMER.cdx
>
> This is the code. I also compiled in pure DOS withour Fivewin and the
> error also arrises:
It's good you've compiled code without FW, but I do not get error (DOS
error 5) on my Win7 box (after I modified your sample to avoid Invalid
path error). It just prints: 1001.
Regards,
Mindaugas
On 2012.02.13 23:06, John Salazar wrote:
> I did not ignore Viktor's message. In fact, I correct and I followed
> his advice in latest prg.
Your code still generates error indicated by Viktor:
> After fixing it, I got this:
> ---
> Error DBFCDX/1001 Open error: DATA\CUSTOMER.dbf (DOS Error 3)
> Called from DBUSEAREA(0)
> Called from MAIN(31)
> Called from HB_HRBRUN(0)
> Called from _APPMAIN(0)
> ---
> Finally, I was asking about what�s wrong about the path. I repeat, the
> sample works fine most of times. I think it�s quite strange.
pPath is unnecessary. You can work in current path. DATA\ subpath is not
created by app. Justy like .dbf itself. I understand, that sometimes you
need to upload .dbf file to show some corrupted .dbf files, you can not
reproduce by short sample, but in current situation, just include .dbf
creation code and do not hardcode any paths.
Regards,
Mindaugas
Just in case it helps you to figure out what is wrong... I had very
little experience with Win7 but what I experienced is that you can not put
your program anywhere because it may not work as expected. I do not know yet
why but it seems that it has something to do with UAC or other type of OS
requirement / registry fix / oplocks issue / SMB2 data corruption / etc...
I do not belive it is Harbour's bug.
Sorry for not helping more. I just saw the topic and had some vague
ideas of what it could be but I would search the OS requirements first.
Regards,
Qatan