Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird Error Writing to File Problem!
Message
From
13/01/2008 10:24:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01281035
Message ID:
01281450
Views:
8
>I need some advice on this one.
>
>Among 20 or so open tables, there is a table calld INV.DBF with a few IDX and one CDX files that are open with it. The CDX file is called INV_.CDX (not the default CDX).

(after having read the whole thread so far)

Depends on what you're doing with that index. If it's a permanent index, then just re-create all of its tags in the structural .cdx and kill inv_.cdx completely. If you need the tags all the time, they better be updated automatically.

If the index is temporary, created when needed, then you'll run into problems when two workstations try to create the same index. Worse, you may find yourself using an index which is desperately outdated.

Assuming that the s: drive is where the app runs, it would be better to have temp indexes on the temp drive/dir, with temp names:
procedure tempname(tcExt)
lcDir=getenv("temp") && or sys(2023), which is another good location
lcExt=evl(tcExt, "tmp")
lcFile=forceext(sys(2015),lcExt)
lcFullPath=fullpath(forcepath(lcfile, lcdir))
return lcFullPath
So create this index like this:
lcCdx=tempname("cdx")
index on ... tag ... of (lcCdx)
and later, when you don't need the index anymore,
erase (lcCdx)
i.e. you better save the filename somewhere so you can clean up when your app exits. Simpler way to achieve that is to use your own subdirectory and simply delete everything you see there when you exit. The Erase command will erase what it can, and it won't report any error if it can't erase something.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform