1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

DeleteFile

unit
Sysutils
category
file management routines

declaration
function DeleteFile(const sFileName: string): boolean;

description
Deletes a specified file.

DeleteFile returns False if the file specified by sFileName does not exists, or the file cannon be deleted.

example
var myapp : string;

myapp := 'c:\My Doucuments\mp3\my_app.old'

if not Delete(mp3File) then begin
 ShowMessage('File not deleted!');
 Abort;
end;

in real code
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.

see also
RenameFile


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.