Do you perchance have Windows 2000?  I have found on Win2k you can usually get away with renaming a file that someone else is using.  This is apparently not possible but works most of the time anyway.
 
Steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, 18 November 2002 12:00
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Check if file is locked?

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

 


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 13/11/2002

Reply via email to