



É necessário estar declarado SysUtils na seção uses,
em versões unicode declare System.SysUtils;
Função do Delphi: FileExists(Arquivo a ser testado);
Exemplos de uso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | procedure TForm1.Button1Click(Sender: TObject); begin { A função retorna verdadeiro se o arquivo existir } if FileExists('C:\teste.txt') then ShowMessage('O Arquivo existe.') else ShowMessage('O Arquivo não existe.'); if FileExists('F:\showdelphi.swd') then ShowMessage('O Arquivo existe.') else ShowMessage('O Arquivo não existe.'); end; |