Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
procedure Erase(var F)
Deletes a file.
Erase accepts any file-type variable F as its parameter. The F is assigned with AssignFile. The F must be closed with CloseFile before erasing. If F exists and is closed it gets deleted, otherwise an EInOutError exception occurs.
var F : file;
if OpenDialog1.Execute then do begin
AsignFile(F, OpenDialog1.FileName);
Erase(F);
end;
|
File IO in Delphi
Working with disk files with Delphi's Pascal. Find out about handling text (ASCII) files, typed files and untyped files.
Deleting group of files
The code example demonstrates using the SHFileOperation function to copy a group of files and display a progress dialog. You can also use the following flags to delete, move and rename a group of files.
DeleteFile
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|