Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP6 - "Delay" in changing DBF files file modified time

Status
Not open for further replies.

ducklord

Technical User
Feb 24, 2022
12
MY
Hi, my company is using an invoicing software (written under VFP6). Programs and table files are hosted on a server pc running Windows Server 2016 Essentials whereas users are running the software via a network path shortcut (e.g.: \\192.168.1.2\account\billing.exe) on their pc running Windows 10 22H2.

I notice that whenever an user issues and saves a new invoice, file modified time ("FMT") of the relevant table files hosted on server would not be updated immediately. Instead, FMT would only change immediately after the user closing the said program. However, users of other pcs are still able to view the new records on their respective pc before the said FMT are updated.

Is this issue something to do with the OS settings? Or due to the way the software is written.

Thanks.
 
Given that I am aware about the FMT unchanged issue, tentatively I would proceed with copying file whenever there is file size change plus copy once a day regardless of any change.

Thank you guys.
 
Ducklord, good to hear that you have come up with a solution - not an ideal one, perhaps, but at least you can go forward now.

Just for the sake of completeness (and to satisfy my own curiosity), I did some more tests - a little bit more carefully this time. I tested updates that didn't change the file size (REPLACE) against ones that did (APPEND BLANK), and also FLUSH with and without FORCE.

My results:

Code:
[b]Test                            Timestamp changed?[/b]

Update, no change to file
size                            No

As above, with FLUSH            No

As above, with FLUSH
FORCE                           Yes

Update, added a record          Yes

I can see why appending a record would force the buffers to be flushed - something to do with locking the file header perhaps. But I really don't understand why adding FORCE to FLUSH would make a difference. The Help says that the effect of FORCE is to "call the Windows API FlushFileBuffers function". I would try calling that function directly just to see if it makes a difference, but I see that it needs a file handle, and I don't know how to find that.

Anyway, I hope the above might be of passing interest.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top