Mar 25, 2004 #1 pranavjosh Programmer Joined Apr 12, 2001 Messages 30 Location IN Hi Friends How to programmatically find out whether the File is in use or not.
Mar 25, 2004 #2 LucieLastic Programmer Joined May 9, 2001 Messages 1,694 Location GB I was thinking you could try to rename it with RenameFile but I think it would let you if it's in use. You may have to try and move it to a temp dir. Upvote 0 Downvote
I was thinking you could try to rename it with RenameFile but I think it would let you if it's in use. You may have to try and move it to a temp dir.
Mar 30, 2004 #3 richardchaven Programmer Joined Jan 13, 2003 Messages 161 Location US try TFileStream.Create(AFileName, fmOpenRead + fmShareExclusive).Free; except on E:EDontDoThatError do begin Someone is using it. end; end; Cheers Upvote 0 Downvote
try TFileStream.Create(AFileName, fmOpenRead + fmShareExclusive).Free; except on E:EDontDoThatError do begin Someone is using it. end; end; Cheers