Solved

File Lock???

Posted on 2000-04-07
3
180 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
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.
0
 
LVL 2

Accepted Solution

by:
PeterLarsen earned 25 total points
ID: 2693983
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
ID: 2695714
Thanks Peter!!!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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