Ultimate Pack

Check if a file exists - Files & folders - Tips & Tricks - Greatis Delphi Pages

Use FileExists function. If file exists, then this function will return True.

procedure TForm1.Button1Click(Sender: TObject);
begin
  if FileExists(Edit1.Text) then
    ShowMessage('File already exists!')
  else
    ShowMessage('This file is unique');
end;
For more
Delphi Help

Download source


Delphi books recommended by Amazon.com

More Delphi programming books on Amazon.com


Copyright © 1998-2014 Greatis Software