Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 19-12-2021, 20:42
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,223 Times in 2,312 Posts
Razor12911 is on a distinguished road
You need to open the file with the intent to both read and writing to it, if this operation fails then it means the file is in use.

Code:
function IsFileInUse(Filename: String): Boolean;
begin
  Result := False;  
  try
    with TFileStream.Create(Filename,fmOpenReadWrite) do // this should fail
    try
    finally
      Free;
    end;
  except
    Result := True; // this handles the exception and tells you the file is in use
  end;
end;

Last edited by Razor12911; 19-12-2021 at 20:47.
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
Cuttlas (21-12-2021)
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Borderlands 2 GOTY omdj PC Games - CD/DVD Conversions 12 07-06-2026 22:52
Useful Dll for Inno Setup users peterf1999 Conversion Tutorials 88 01-12-2017 16:00
Midway Arcade Treasures 2 kartking CD/DVD Copy Protections & Utilities 5 19-11-2007 08:19
HELP ME PLZ!!!! Dalvin DC Games 0 02-01-2001 22:14



All times are GMT -7. The time now is 11:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com