FYI...this morning I had a DLL locked, which I wanted to delete. It wouldn't let me, so I renamed it successfully - even though locked. Not sure if that was because of my rights or whether renaming a locked file always works?
 
Dave
-----Original Message-----
From: Conor Boyd [mailto:[EMAIL PROTECTED]]
Sent: Monday, 18 November 2002 11:54
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Check if file is locked?

Had a look after you posted last week, but couldn't find much, I'm afraid.
 
Will the OS not prevent you from renaming if files are open/locked?  If so, why not just try the rename and catch any exceptions?
 
Cheers,
 
Conor
-----Original Message-----
From: Jason Coley [mailto:[EMAIL PROTECTED]]
Sent: Monday, 18 November 2002 11:50 a.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Check if file is locked?

Hi all,

 

I am trying to write some code that will rename a folder, but I need to know whether I can, ie no files are open or locked by another process, user etc. So I need to know the quickest and easiest method for finding out whether its OK or not to rename the folder.

 

Does anyone have any suggestions?

 

Jason

 

Reply via email to