File Lock???

Posted on 2000-04-07
Last Modified: 2010-04-04
I have a text file (the size about 3 Mb).
I read that file and store it to table (TTable).
After all process done, and I close the file using command: system.close(FileVar).
After that I move file to specified folder using API function MoveFile.
The problem is sometimes, it returns error, called ERROR_ACCESS_DENIED
(get from GetLastError function).
It seems that the system still locks the file.
How to solve this problem?

Need help from any Delphi Expert

Question by:daniel_c
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 2693300
Are you using Windows NT?

I had this same problem with NT.  I solved the problem by adding a Sleep(200) after closing the file.

Accepted Solution

PeterLarsen earned 25 total points
ID: 2693983
Hi daniel c,

I have had a similar problem some time ago : 

Good luck

Author Comment

ID: 2695714
Thanks Peter!!!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month4 days, 1 hour left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question