Skip to content

TommiPrami/Delphi.GetProcessReservingFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delphi.GetProcessReservingFile

Method to get process that has file opened, if any.

Heavily influenced by: https://devblogs.microsoft.com/oldnewthing/20120217-00/?p=8283

Usage

try
  OpenAndProcessFile(LFileName);
excpet
  on E: Exception do
  begin
    ...
    if GetProcessReservingFile(LFileName, LProcessFileName) then
      LErrorMEssage := LErrorMEssage + ' The process that is holding your file as a hostage is: "' + LProcessFileName + '"';
  end;
end;

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages