Solved

File Lock???

Posted on 2000-04-07
3
178 Views
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

Daniel
0
Comment
Question by:daniel_c
3 Comments
 

Expert Comment

by:dhertzfe
Comment Utility
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.
0
 
LVL 2

Accepted Solution

by:
PeterLarsen earned 25 total points
Comment Utility
Hi daniel c,

I have had a similar problem some time ago :

http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10109545

Good luck
Peter
0
 
LVL 7

Author Comment

by:daniel_c
Comment Utility
Thanks Peter!!!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now