Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19-12-2021, 20:42
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,761
Thanks: 2,192
Thanked 11,250 Times in 2,319 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)
Sponsored Links
  #2  
Old 20-12-2021, 21:26
Cuttlas's Avatar
Cuttlas Cuttlas is offline
Registered User
 
Join Date: Aug 2020
Location: Near You :)
Posts: 63
Thanks: 19
Thanked 10 Times in 5 Posts
Cuttlas is on a distinguished road
Lightbulb

what happens if the file is so big? does it take too long?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:55.


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